Part Number Hot Search : 
0120A 239800P 00SER GR501 SY3417B 10040 5KP90 C1213
Product Description
Full Text Search
 

To Download P87C554SXAA Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
   

p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o product data supersedes data of 1998 aug 14 2002 mar 25 integrated circuits
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 i description 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . features 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ordering information 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . part number derivation 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . block diagram 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . pinning information 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . plastic leaded chip carrier pin functions 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . logic symbol 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . pin description 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . special function registers 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . oscillator characteristics 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . reset 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . low power modes 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . stop clock mode 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . idle mode 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . power-down mode 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . power off flag 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . design consideration 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . oncee mode 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . reduced emi mode 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . expanded data ram addressing 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . dual dptr 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . dptr instructions 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . enhanced uart 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . automatic address recognition 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . timer t2 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . timer t3, the watchdog timer 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . serial i/o 21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . port 5 operation 21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . pulse width modulated outputs 21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . analog-to-digital converter 21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . power reduction modes 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . interrupts 28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . absolute maximum ratings 61 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . device specifications 61 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . dc electrical characteristics 62 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ac electrical characteristics 65 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . explanation of the ac symbols 67 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . eprom characteristics 72 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . program verification 72 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . security bits 72 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . revision history 74 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 1 2002 mar 25 853-2324 27926 description the p87c554 single-chip 8-bit microcontroller is manufactured in an advanced cmos process and is a derivative of the 80c51 microcontroller family. the 87c554 has the same instruction set as the 80c51. the 87c554 contains a 16k 8 non-volatile eprom, a 512 8 read/write data memory, five 8-bit i/o ports, one 8-bit input port, two 16-bit timer/event counters (identical to the timers of the 80c51), an additional 16-bit timer coupled to capture and compare latches, a 15-source, four-priority-level, nested interrupt structure, an 8-input adc, a dual dac pulse width modulated interface, two serial interfaces (uart and i 2 c-bus), a awatchdogo timer and on-chip oscillator and timing circuits. for systems that require extra capability, the p87c554 can be expanded using standard ttl compatible memories and logic. in addition, the p87c554 has two software selectable modes of power reductioneidle mode and power-down mode. the idle mode freezes the cpu while allowing the ram, timers, serial ports, and interrupt system to continue functioning. optionally, the adc can be operated in idle mode. the power-down mode saves the ram contents but freezes the oscillator, causing all other chip functions to be inoperative. the device also functions as an arithmetic processor having facilities for both binary and bcd arithmetic plus bit-handling capabilities. the instruction set consists of over 100 instructions: 49 one-byte, 45 two-byte, and 17 three-byte. with a 16 mhz crystal, 58% of the instructions are executed in 0.75 m s and 40% in 1.5 m s. multiply and divide instructions require 3 m s. features ? 80c51 central processing unit ? 16k 8 eprom expandable externally to 64k bytes ? an additional 16-bit timer/counter coupled to four capture registers and three compare registers ? two standard 16-bit timer/counters ? 512 8 ram, expandable externally to 64k bytes ? capable of producing eight synchronized, timed outputs ? a 10-bit adc with eight multiplexed analog inputs ? fast 8-bit adc option ? two 8-bit resolution, pulse width modulation outputs ? five 8-bit i/o ports plus one 8-bit input port shared with analog inputs ? i 2 c-bus serial i/o port with byte oriented master and slave functions ? on-chip watchdog timer ? extended temperature ranges ? full static operation 0 to 16 mhz ? operating voltage range: 2.7 v to 5.5 v (0 to 16 mhz) and 4.5 v to 5.5 v (16 to 33 mhz) ? three security bits ? encryption array 64 bytes ? 4 level priority interrupt ? 15 interrupt sources ? full-duplex enhanced uart framing error detection automatic address recognition ? power control modes clock can be stopped and resumed idle mode power down mode ? second dptr register ? ale inhibit for emi reduction ? programmable i/o pins ? wake-up from power-down by external interrupts ? software reset ? power-on detect reset ? adc charge pump disable ? once mode ? adc active in idle mode
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 2 ordering information otp/eprom temperature c and package freq. (mhz) drawing number p87c554sbaa 0 to +70, plastic leaded chip carrier 16 sot1883 p87c554sfaa 40 to +85, plastic leaded chip carrier 16 sot1883 part number derivation device number (p87c554) operating frequency max (s) temperature range (b) package (aa) p87c554 otp s = 16 mhz b= 0  c to 70  c f = 40  c to +85  c aa = plcc block diagram cpu adc 8-bit internal bus 16 p0 p1 p2 p3 txd rxd p5 p4 ct0i-ct3i t2 rt2 cmsr0-cmsr5 cmt0, cmt1 rst ew xtal1 xtal2 ea ale psen wr rd t0 t1 int0 int1 v dd v ss pwm0 pwm1 av ss av dd av ref + stadc adc0-7 sda scl 3 3 3 3 3 3 0 2 1 1 1 4 1 1 5 0 1 2 alternate function of port 0 3 4 5 ad0-7 a8-15 3 3 16 t0, t1 two 16-bit timer/event counters program memory 16k x 8 otp/rom data memory 512 x 8 ram dual pwm serial i 2 c port 80c51 core excluding rom/ram parallel i/o ports and external bus serial uart port 8-bit port four 16-bit capture latches t2 16-bit timer/ event counters t2 16-bit compara- tors with registers compara- tor output selection t3 watchdog timer alternate function of port 1 alternate function of port 2 alternate function of port 3 alternate function of port 4 alternate function of port 5 su00951
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 3 pinning information plastic leaded chip carrier pin functions pin function 1 p5.0/adc0 2v dd 3 stadc 4 pwm0 5 pwm1 6ew 7 p4.0/cmsr0 8 p4.1/cmsr1 9 p4.2/cmsr2 10 p4.3/cmsr3 11 p4.4/cmsr4 12 p4.5/cmsr5 13 p4.6/cmt0 14 p4.7/cmt1 15 rst 16 p1.0/ct0i 17 p1.1/ct1i 18 p1.2/ct2i 19 p1.3/ct3i 20 p1.4/t2 21 p1.5/rt2 22 p1.6/scl 23 p1.7/sda pin function 24 p3.0/rxd 25 p3.1/txd 26 p3.2/int0 27 p3.3/int1 28 p3.4/t0 29 p3.5/t1 30 p3.6/wr 31 p3.7/rd 32 nc 33 nc 34 xtal2 35 xtal1 36 v ss 37 v ss 38 nc 39 p2.0/a08 40 p2.1/a09 41 p2.2/a10 42 p2.3/a11 43 p2.4/a12 44 p2.5/a13 45 p2.6/a14 46 p2.7/a15 pin function 47 psen 48 ale/prog 49 ea /v pp 50 p0.7/ad7 51 p0.6/ad6 52 p0.5/ad5 53 p0.4/ad4 54 p0.3/ad3 55 p0.2/ad2 56 p0.1/ad1 57 p0.0/ad0 58 avref 59 avref+ 60 av ss 61 av dd 62 p5.7/adc7 63 p5.6/adc6 64 p5.5/adc5 65 p5.4/adc4 66 p5.3/adc3 67 p5.2/adc2 68 p5.1/adc1 su00208 9161 60 44 43 27 26 10 plastic leaded chip carrier logic symbol port 5 port 4 adc0-7 cmt0 cmt1 cmsr0-5 rst ew xtal1 xtal2 ea/ v pp ale/prog psen avref+ avref stadc pwm0 pwm1 port 0 low order address and data bus port 1 port 2 port 3 ct0i ct1i ct2i ct3i t2 rt2 scl sda rxd/data txd/clock int0 int1 t0 t1 wr rd v ss v dd av ss av dd high order address and data bus su00210
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 4 pin description table 1. pin description mnemonic pin no. type name and function v dd 2 i digital power supply: positive voltage power supply pin during normal operation, idle and power-down mode. stadc 3 i start adc operation: input starting analog to digital conversion (adc operation can also be started by software). pwm0 4 o pulse width modulation: output 0. pwm1 5 o pulse width modulation: output 1. ew 6 i enable watchdog timer: enable for t3 watchdog timer and disable power-down mode. p0.0-p0.7 57-50 i/o port 0: port 0 is an 8-bit open-drain bidirectional i/o port. port 0 pins that have 1s written to them float and can be used as high-impedance inputs. port 0 is also the multiplexed low-order address and data bus during accesses to external program and data memory. in this application it uses strong internal pull-ups when emitting 1s. port 0 is also used to input the code byte during programming and to output the code byte during verification. p1.0-p1.7 16-23 i/o port 1: 8-bit i/o port. alternate functions include: 16-21 i/o (p1.0-p1.5): programmable i/o port pins. 22-23 i/o (p1.6, p1.7): open drain port pins. 16-19 i ct0i-ct3i (p1.0-p1.3): capture timer input signals for timer t2. 20 i t2 (p1.4): t2 event input. 21 i rt2 (p1.5): t2 timer reset signal. rising edge triggered. 22 i/o scl (p1.6): serial port clock line i 2 c-bus. 23 i/o sda (p1.7): serial port data line i 2 c-bus. port 1 has four modes selected on a per bit basis by writing to the p1m1 and p1m2 registers as follows: p1m1.x p1m2.x mode description 0 0 pseudobidirectional (standard c51 configuration; default) 0 1 push-pull 1 0 high impedance 1 1 open drain port 1 is also used to input the lower order address byte during eprom programming and verification. a0 is on p1.0, etc. p2.0-p2.7 39-46 i/o port 2: 8-bit programmable i/o port. alternate function: high-order address byte for external memory (a08-a15). port 2 is also used to input the upper order address during eprom programming and verification. a8 is on p2.0, a9 on p2.1, through a13 on p2.5. port 2 has four output modes selected on a per bit basis by writing to the p2m1 and p2m2 registers as follows: p2m1.x p2m2.x mode description 0 0 pseudobidirectional (standard c51 configuration; default) 0 1 push-pull 1 0 high impedance 1 1 open drain p3.0-p3.7 24-31 i/o port 3: 8-bit programmable i/o port. alternate functions include: 24 rxd(p3.0): serial input port. 25 txd (p3.1): serial output port. 26 int0 (p3.2): external interrupt. 27 int1 (p3.3): external interrupt. 28 t0 (p3.4): timer 0 external input. 29 t1 (p3.5): timer 1 external input. 30 wr (p3.6): external data memory write strobe. 31 rd (p3.7): external data memory read strobe. port 3 has four modes selected on a per bit basis by writing to the p3m1 and p3m2 registers as follows: p3m1.x p3m2.x mode description 0 0 pseudobidirectional (standard c51 configuration; default) 0 1 pushpull 1 0 high impedance 1 1 open drain
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 5 pin description (continued) mnemonic pin no. type name and function p4.0-p4.7 7-14 i/o port 4: 8-bit programmable i/o port. alternate functions include: 7-12 o cmsr0-cmsr5 (p4.0-p4.5): timer t2 compare and set/reset outputs on a match with timer t2. 13, 14 o cmt0, cmt1 (p4.6, p4.7): timer t2 compare and toggle outputs on a match with timer t2. port 4 has four modes selected on a per bit basis by writing to the p4m1 and p4m2 registers as follows: p4m1.x p4m2.x mode description 0 0 pseudo-bidirectional (standard c51 configuration; default) 0 1 push-pull 1 0 high impedance 1 1 open drain p5.0-p5.7 68-62, 1 i port 5: 8-bit input port. 1 adc0-adc7 (p5.0-p5.7): alternate function: eight input channels to the adc. rst 15 i/o reset: input to reset the 87c554. it also provides a reset pulse as output when timer t3 overflows. xtal1 35 i crystal input 1: input to the inverting amplifier that forms the oscillator, and input to the internal clock generator. receives the external clock signal when an external oscillator is used. xtal2 34 o crystal input 2: output of the inverting amplifier that forms the oscillator. left open-circuit when an external clock is used. v ss 36, 37 i digital ground. psen 47 o program store enable: active-low read strobe to external program memory. ale/prog 48 o address latch enable: latches the low byte of the address during accesses to external memory. it is activated every six oscillator periods. during an external data memory access, one ale pulse is skipped. ale can drive up to eight ls ttl inputs and handles cmos inputs without an external pull-up. this pin is also the program pulse input (prog ) during eprom programming. ea /v pp 49 i external access: when ea is held at ttl level high, the cpu executes out of the internal program rom provided the program counter is less than 16,384. when ea is held at ttl low level, the cpu executes out of external program memory. ea is not allowed to float. this pin also receives the 12.75 v programming supply voltage (v pp ) during eprom programming. av ref 58 i analog to digital conversion reference resistor: low-end. av ref+ 59 i analog to digital conversion reference resistor: high-end. av ss 60 i analog ground av dd 61 i analog power supply note: 1. to avoid alatch-upo effect at power-on, the voltage on any pin at any time must not be higher or lower than v dd + 0.5 v or v ss 0.5 v, respectively.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 6 special function registers table 1. special function registers symbol description direct address bit address, symbol, or alternative port function msb lsb reset value acc* accumulator e0h e7 e6 e5 e4 e3 e2 e1 e0 00h adch# a/d converter high c6h xxxxxxxxb adcon# a/d control c5h adc.1 adc.0 adex adci adcs aadr2 aadr1 aadr0 xx000000b auxr auxiliary 8eh lvadc extram a0 xxxxx110b auxr1 auxiliary a2h adc8 aidl srst gf2 wupd o dps 000000x0b b* b register f0h f7 f6 f5 f4 f3 f2 f1 f0 00h ctcon# capture control ebh ctn3 ctp3 ctn2 ctp2 ctn1 ctp1 ctn0 ctp0 00h cth3# capture high 3 cfh xxxxxxxxb cth2# capture high 2 ceh xxxxxxxxb cth1# capture high 1 cdh xxxxxxxxb cth0# capture high 0 cch xxxxxxxxb cmh2# compare high 2 cbh 00h cmh1# compare high 1 cah 00h cmh0# compare high 0 c9h 00h ctl3# capture low 3 afh xxxxxxxxb ctl2# capture low 2 aeh xxxxxxxxb ctl1# capture low 1 adh xxxxxxxxb ctl0# capture low 0 ach xxxxxxxxb cml2# compare low 2 abh 00h cml1# compare low 1 aah 00h cml0# compare low 0 a9h 00h dptr: dph dpl data pointer (2 bytes): data pointer high data pointer low 83h 82h 00h 00h af ae ad ac ab aa a9 a8 ien0*# interrupt enable 0 a8h ea ead es1 es0 et1 ex1 et0 ex0 00h ef ee ed ec eb ea e9 e8 ien1*# interrupt enable 1 e8h et2 ecm2 ecm1 ecm0 ect3 ect2 ect1 ect0 00h bf be bd bc bb ba b9 b8 ip0*# interrupt priority 0 b8h pad ps1 ps0 pt1 px1 pt0 px0 x0000000b ff fe fd fc fb fa f9 f8 ip0h interrupt priority 0 high b7h padh ps1h ps0h pt1h px1h pt0h px0h x0000000b ip1*# interrupt priority1 f8h pt2 pcm2 pcm1 pcm0 pct3 pct2 pct1 pct0 00h ip1h interrupt priority 1 high f7h pt2h pcm2h pcm1h pcm0h pct3h pct2h pct1h pct0h 00h p5# port 5 c4h adc7 adc6 adc5 adc4 adc3 adc2 adc1 adc0 xxxxxxxxb c7 c6 c5 c4 c3 c2 c1 c0 p4#* port 4 c0h cmt1 cmt0 cmsr5 cmsr4 cmsr3 cmsr2 cmsr1 cmsr0 ffh b7 b6 b5 b4 b3 b2 b1 b0 p3* port 3 b0h rd wr t1 t0 int1 int0 txd rxd ffh a7 a6 a5 a4 a3 a2 a1 a0 p2* port 2 a0h a15 a14 a13 a12 a11 a10 a9 a8 ffh 97 96 95 94 93 92 91 90 p1* port 1 90h sda scl rt2 t2 ct3i ct2i ct1i ct0i ffh 87 86 85 84 83 82 81 80 p0* port 0 80h ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0 ffh
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 7 symbol reset value bit address, symbol, or alternative port function msb lsb direct address description p1m1 port 1 output mode 1 92h xx000000b p1m2 port 1 output mode 2 93h xx000000b p2m1 port 2 output mode 1 94h 00h p2m2 port 2 output mode 2 95h 00h p3m1 port 3 output mode 1 9ah 00h p3m2 port 3 output mode 2 9bh 00h p4m1 port 4 output mode 1 9ch 00h p4m2 port 4 output mode 2 9dh 00h pcon power control 87h smod1 smod0 pof wle gf1 gfo pd idl 00x00000b psw program status word d0h cy ac fo rs1 rs0 ov f1 p 00h pwmp# pwm prescaler feh 00h pwm1# pwm register 1 fdh 00h pwm0# pwm register 0 fch 00h rte# reset/toggle enable efh tp47 tp46 rp45 rp44 rp43 rp42 rp41 rp40 00h s0addr serial 0 slave address f9h 00h s0aden slave address mask b9h 00h s0buf serial 0 data buffer 99h xxxxxxxxb 9f 9e 9d 9c 9b 9a 99 98 s0con* serial 0 control 98h sm0/fe sm1 sm2 ren tb8 rb8 ti ri 00h s1adr# serial 1 address dbh slave address gc 00h sidat# serial 1 data dah 00h s1sta# serial 1 status d9h sc4 sc3 sc2 sc1 sc0 0 0 0 f8h df de dd dc db da d9 d8 sicon#* serial 1 control d8h cr2 ens1 sta st0 si aa cr1 cr0 00h sp stack pointer 81h 07h ste# set enable eeh tg47 tg46 sp45 sp44 sp43 sp42 sp41 sp40 c0h th1 th0 tl1 tl0 tmh2# tml2# timer high 1 timer high 0 timer low 1 timer low 0 timer high 2 timer low 2 8dh 8ch 8bh 8ah edh ech 00h 00h 00h 00h 00h 00h tmod timer mode 89h gate c/t m1 m0 gate c/t m1 m0 00h 8f 8e 8d 8c 8b 8a 89 88 tcon* timer control 88h tf1 tr1 tf0 tr0 ie1 it1 ie0 it0 00h tm2con# timer 2 control eah t2is1 t2is0 t2er t2b0 t2p1 t2p0 t2ms1 t2ms0 00h cf ce cd cc cb ca c9 c8 tm2ir#* timer 2 int flag reg c8h t20v cmi2 cmi1 cmi0 cti3 cti2 cti1 cti0 00h t3# timer 3 ffh 00h * sfrs are bit addressable. # sfrs are modified from or added to the 80c51 sfrs.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 8 oscillator characteristics xtal1 and xtal2 are the input and output, respectively, of an inverting amplifier. the pins can be configured for use as an on-chip oscillator, as shown in the logic symbol. to drive the device from an external clock source, xtal1 should be driven while xtal2 is left unconnected. there are no requirements on the duty cycle of the external clock signal, because the input to the internal clock circuitry is through a divide-by-two flip-flop. however, minimum and maximum high and low times specified in the data sheet must be observed. reset a reset is accomplished by either (1) externally holding the rst pin high for at least two machine cycles (24 oscillator periods) or (2) internally by an on-chip power-on detect (pod) circuit which detects v cc ramping up from 0 v. to insure a good external power-on reset, the rst pin must be high long enough for the oscillator to start up (normally a few milliseconds) plus two machine cycles. the voltage on v dd and the rst pin must come up at the same time for a proper startup. for a successful internal power-on reset, the v cc voltage must ramp up from 0 v smoothly at a ramp rate greater than 5 v/100 ms. the rst line can also be pulled high internally by a pull-up transistor activated by the watchdog timer t3. the length of the output pulse from t3 is 3 machine cycles. a pulse of such short duration is necessary in order to recover from a processor or system fault as fast as possible. note that the short reset pulse from timer t3 cannot discharge the power-on reset capacitor (see figure 2). consequently, when the watchdog timer is also used to set external devices, this capacitor arrangement should not be connected to the rst pin, and a different circuit should be used to perform the power-on reset operation. a timer t3 overflow, if enabled, will force a reset condition to the p87c554 by an internal connection, independent of the level of the rst pin. a reset may be performed in software by setting the software reset bit, srst (auxr1.5). v dd r rst rst schmitt trigger reset circuitry on-chip resistor overflow timer t3 su00952 figure 1. on-chip reset configuration r rst v dd v dd + 2.2 m f p87c554 rst su01649 figure 2. power-on reset low power modes stop clock mode the static design enables the clock speed to be reduced down to 0 mhz (stopped). when the oscillator is stopped, the ram and special function registers retain their values. this mode allows step-by-step utilization and permits reduced system power consumption by lowering the clock frequency down to any value. for lowest power consumption the power down mode is suggested. idle mode in the idle mode (see table 2), the cpu puts itself to sleep while some of the on-chip peripherals stay active. the instruction to invoke the idle mode is the last instruction executed in the normal operating mode before the idle mode is activated. the cpu contents, the on-chip ram, and all of the special function registers remain intact during this mode. the idle mode can be terminated either by any enabled interrupt (at which time the process is picked up at the interrupt service routine and continued), or by a hardware reset which starts the processor in the same manner as a power-on reset. power-down mode to save even more power, a power down mode (see table 2) can be invoked by software. in this mode, the oscillator is stopped and the instruction that invoked power down is the last instruction executed. the on-chip ram and special function registers retain their values down to 2.0 v and care must be taken to return v cc to the minimum specified operating voltages before the power down mode is terminated. either a hardware reset or external interrupt can be used to exit from power down. the wake-up from power-down bit, wupd (auxr1.3) must be set in order for an external interrupt to cause a wake-up from power-down. reset redefines all the sfrs but does not change the on-chip ram. an external interrupt allows both the sfrs and the on-chip ram to retain their values. to properly terminate power down the reset or external interrupt should not be executed before v cc is restored to its normal operating level and must be held active long enough for the oscillator to restart and stabilize (normally less than 10 ms).
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 9 table 2. external pin status during idle and power-down modes mode program memory ale psen port 0 port 1 port 2 port 3 port 4 pwm0/ pwm1 idle internal 1 1 data data data data data high idle external 1 1 float data address data data high power-down internal 0 0 data data data data data high power-down external 0 0 float data data data data high with an external interrupt, int0 and int1 must be enabled and configured as level-sensitive. holding the pin low restarts the oscillator but bringing the pin back high completes the exit. once the interrupt is serviced, the next instruction to be executed after reti will be the one following the instruction that put the device into power down. power off flag the power off flag (pof) is set by on-chip circuitry when the v cc level on the p87c554 rises from 0 to 5 v. the pof bit can be set or cleared by software allowing a user to determine if the reset is the result of a power-on or a warm start after powerdown. the v cc level must remain above 3 v for the pof to remain unaffected by the v cc level. design consideration ? when the idle mode is terminated by a hardware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control. on-chip hardware inhibits access to internal ram in this event, but access to the port pins is not inhibited. to eliminate the possibility of an unexpected write when idle is terminated by reset, the instruction following the one that invokes idle should not be one that writes to a port pin or to external memory. once ? mode the once (aon-circuit emulationo) mode facilitates testing and debugging of systems without the device having to be removed from the circuit. the once mode is invoked by: 1. pull ale low while the device is in reset and psen is high; 2. hold ale low as rst is deactivated. while the device is in once mode, the port 0 pins go into a float state, and the other port pins and ale and psen are weakly pulled high. the oscillator circuit remains active. while the device is in this mode, an emulator or test cpu can be used to drive the circuit. normal operation is restored when a normal reset is applied. reduced emi mode the ale-off bit, ao (auxr.0) can be set to disable the ale output. it will automatically become active when required for external memory accesses and resume to the off state after completing the external memory access. if logic 1s are written to pd and idl at the same time, pd takes precedence. the reset value of pcon is (00x00000). su00954 idl bit symbol function pcon.7 smod1 double baud rate bit. when set to logic 1, the baud rate is doubled when the serial port sio0 is being used in modes 1, 2, or 3. pcon.6 smod0 selects sm0/fe for scon.7 bit. pcon.5 pof power off flag pcon.4 wle watchdog load enable. this flag must be set by software prior to loading timer t3 (watchdog timer). it is cleared when timer t3 is loaded. pcon.3 gf1 general-purpose flag bit. pcon.2 gf0 general-purpose flag bit. pcon.1 pd power-down bit. setting this bit activates the power-down mode. it can only be set if input ew is high. pcon.0 idl idle mode bit. setting this bit activates the idle mode. pd gf0 gf1 wle pof smod0 smod1 0 1 2 3 4 5 6 7 (lsb) (msb) pcon (87h) figure 3. power control register (pcon)
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 10 expanded data ram addressing the p87c554 has internal data memory that is mapped into four separate segments: the lower 128 bytes of ram, upper 128 bytes of ram, 128 bytes special function register (sfr), and 256 bytes expanded ram (extram). the four segments are: 1. the lower 128 bytes of ram (addresses 00h to 7fh) are directly and indirectly addressable. 2. the upper 128 bytes of ram (addresses 80h to ffh) are indirectly addressable only. 3. the special function registers, sfrs, (addresses 80h to ffh) are directly addressable only. 4. the 256-bytes expanded ram (eram, 00h ffh) are indirectly accessed by move external instruction, movx, and with the extram bit cleared, see figure 4. the lower 128 bytes can be accessed by either direct or indirect addressing. the upper 128 bytes can be accessed by indirect addressing only. the upper 128 bytes occupy the same address space as the sfr. that means they have the same address, but are physically separate from sfr space. when an instruction accesses an internal location above address 7fh, the cpu knows whether the access is to the upper 128 bytes of data ram or to sfr space by the addressing mode used in the instruction. instructions that use direct addressing access sfr space. for example: mov 0a0h,#data accesses the sfr at location 0a0h (which is p2). instructions that use indirect addressing access the upper 128 bytes of data ram. for example: mov @r0,#data where r0 contains 0a0h, accesses the data byte at address 0a0h, rather than p2 (whose address is 0a0h). the eram can be accessed by indirect addressing, with extram bit cleared and movx instructions. this part of memory is physically located on-chip, logically occupies the first 256-bytes of external data memory. with extram = 0, the extram is indirectly addressed, using the movx instruction in combination with any of the registers r0, r1 of the selected bank or dptr. an access to eram will not affect ports p0, p3.6 (wr#) and p3.7 (rd#). p2 sfr is output during expanded ram addressing. for example, with extram = 0, movx @r0,#data where r0 contains 0a0h, accesses the eram at address 0a0h rather than external memory. an access to external data memory locations higher than ffh (i.e., 0100h to ffffh) will be performed with the movx dptr instructions in the same way as in the standard 80c51, so with p0 and p2 as data/address bus, and p3.6 and p3.7 as write and read timing signals. refer to figure 5. with extram = 1, movx @ri and movx @dptr will be similar to the standard 80c51. movx @ ri will provide an 8-bit address multiplexed with data on port 0 and any output port pins can be used to output higher order address bits. this is to provide the external paging capability. movx @dptr will generate a 16-bit address. port 2 outputs the high-order eight address bits (the contents of dph) while port 0 multiplexes the low-order eight address bits (dpl) with data. movx @ri and movx @dptr will generate either read or write signals on p3.6 (#wr) and p3.7 (#rd). the stack pointer (sp) may be located anywhere in the 256 bytes ram (lower and upper ram) internal data memory. the stack may not be located in the eram address space. auxr reset value = xxxx x110b e eeee lvadc extram ao not bit addressable bit: symbol function ao disable/enable ale ao operating mode 0 ale is emitted at a constant rate of 1/6 the oscillator frequency. 1 ale is active only during a movx or movc instruction. extram internal/external ram (00h ffh) access using movx @ri/@dptr extram operating mode 0 internal eram (00hffh) access using movx @ri/@dptr 1 external data memory access. lvadc enable a/d low voltage operation lvadc operating mode 0 turns off a/d charge pump. 1 turns on a/d charge pump. required for operation below 4v. e not implemented, reserved for future use*. note: *user software should not write 1s to reserved bits. these bits may be used in future 8051 family products to invoke new featur es. in that case, the reset or inactive value of the new bit will be 0, and its active value will be 1. the value read from a reserved bit is indeterminate. su00979a 76543210 address = 8eh figure 4. auxr: auxiliary register
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 11 eram 256 bytes upper 128 bytes internal ram lower 128 bytes internal ram special function register ff 00 ff 00 ff 00 80 80 external data memory ffff 0000 0100 su00980 figure 5. internal and external data memory address space with extram = 0 dual dptr the dual dptr structure (see figure 6) is a way by which the chip will specify the address of an external data memory location. there are two 16-bit dptr registers that address the external memory, and a single bit called dps = auxr1/bit0 that allows the program code to switch between them. the dps bit status should be saved by software when switching between dptr0 and dptr1. dps dptr1 dptr0 dph (83h) dpl (82h) external data memory su00745a bit0 auxr1 figure 6. note that bit 2 is not writable and is always read as a zero. this allows the dps bit to be quickly toggled simply by executing an inc auxr1 instruction without affecting the other bits. dptr instructions the instructions that refer to dptr refer to the data pointer that is currently selected using the auxr1/bit 0 register. the six instructions that use the dptr are as follows: inc dptr increments the data pointer by 1 mov dptr, #data16 loads the dptr with a 16-bit constant mov a, @ a+dptr move code byte relative to dptr to acc movx a, @ dptr move external ram (16-bit address) to acc movx @ dptr , a move acc to external ram (16-bit address) jmp @ a + dptr jump indirect relative to dptr the data pointer can be accessed on a byte-by-byte basis by specifying the low or high byte in an instruction which accesses the sfrs. see application note an458 for more details.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 12 auxr1 reset value = 0000 00x0b adc8 aidl srst gf2 wupd 0 e dsp not bit addressable bit: symbol function dps data pointer switcheswitches between dprt0 and dptr1. dps operating mode 0 dptr0 1 dptr1 wupd enable wakeup from powerdown. gf2 general purpose flageset and cleared by the user. srst software reset aidl enables the adc during idle mode. adc8 adc mode switcheswitches between 10-bit conversion and 8-bit conversion. adc8 operating mode 0 10-bit conversion (50 machine cycles) 1 8-bit conversion (24 machine cycles) note: *user software should not write 1s to reserved bits. these bits may be used in future 8051 family products to invoke new featur es. in that case, the reset or inactive value of the new bit will be 0, and its active value will be 1. the value read from a reserved bit is indeterminate. su01081 76543210 address = a2h figure 7. auxr1: dptr control register
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 13 enhanced uart the uart operates in all of the usual modes that are described in the first section of data handbook ic20, 80c51-based 8-bit microcontrollers . in addition the uart can perform framing error detect by looking for missing stop bits, and automatic address recognition. the uart also fully supports multiprocessor communication as does the standard 80c51 uart. when used for framing error detect the uart looks for missing stop bits in the communication. a missing bit will set the fe bit in the s0con register. the fe bit shares the s0con.7 bit with sm0 and the function of s0con.7 is determined by pcon.6 (smod0) (see figure 8). if smod0 is set then s0con.7 functions as fe. s0con.7 functions as sm0 when smod0 is cleared. when used as fe s0con.7 can only be cleared by software. refer to figure 9. automatic address recognition automatic address recognition is a feature which allows the uart to recognize certain addresses in the serial bit stream by using hardware to make the comparisons. this feature saves a great deal of software overhead by eliminating the need for the software to examine every serial address which passes by the serial port. this feature is enabled by setting the sm2 bit in s0con. in the 9 bit uart modes, mode 2 and mode 3, the receive interrupt flag (ri) will be automatically set when the received byte contains either the agiveno address or the abroadcasto address. the 9 bit mode requires that the 9th information bit is a 1 to indicate that the received information is an address and not data. automatic address recognition is shown in figure 10. the 8 bit mode is called mode 1. in this mode the ri flag will be set if sm2 is enabled and the information received has a valid stop bit following the 8 address bits and the information is either a given or broadcast address. s0con address = 98h reset value = 0000 0000b sm0/fe sm1 sm2 ren tb8 rb8 tl rl bit addressable (smod0 = 0/1)* symbol function fe framing error bit. this bit is set by the receiver when an invalid stop bit is detected. the fe bit is not cleared by valid frames but should be cleared by software. the smod0 bit must be set to enable access to the fe bit. sm0 serial port mode bit 0, (smod0 must = 0 to access bit sm0) sm1 serial port mode bit 1 sm0 sm1 mode description baud rate** 0 0 0 shift register f osc /6 0 1 1 8-bit uart variable 1 0 2 9-bit uart f osc /32 or f osc /16 1 1 3 9-bit uart variable sm2 enables the automatic address recognition feature in modes 2 or 3. if sm2 = 1 then rl will not be set unless the received 9th data bit (rb8) is 1, indicating an address, and the received byte is a given or broadcast address. in mode 1, if sm2 = 1 then rl will not be activated unless a valid stop bit was received, and the received byte is a given or broadcast address. in mode 0, sm2 should be 0. ren enables serial reception. set by software to enable reception. clear by software to disable reception. tb8 the 9th data bit that will be transmitted in modes 2 and 3. set or clear by software as desired. rb8 in modes 2 and 3, the 9th data bit that was received. in mode 1, if sm2 = 0, rb8 is the stop bit that was received. in mode 0, rb8 is not used. tl transmit interrupt flag. set by hardware at the end of the 8th bit time in mode 0, or at the beginning of the stop bit in the other modes, in any serial transmission. must be cleared by software. rl receive interrupt flag. set by hardware at the end of the 8th bit time in mode 0, or halfway through the stop bit time in the other modes, in any serial reception (except see sm2). must be cleared by software. note: *smod0 is located at pcon6. **f osc = oscillator frequency su01445 bit: 76543210 figure 8. s0con: serial port control register
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 14 smod1 smod0 pof wle gf1 gf0 pd idl pcon (87h) sm0 / fe sm1 sm2 ren tb8 rb8 ti ri scon (98h) d0 d1 d2 d3 d4 d5 d6 d7 d8 stop bit data byte only in mode 2, 3 start bit set fe bit if stop bit is 0 (framing error) sm0 to uart mode control 0 : s0con.7 = sm0 1 : s0con.7 = fe su00982 figure 9. uart framing error detection sm0 sm1 sm2 ren tb8 rb8 ti ri scon (98h) d0 d1 d2 d3 d4 d5 d6 d7 d8 1 1 1 0 comparator 11 x received address d0 to d7 programmed address in uart mode 2 or mode 3 and sm2 = 1: interrupt if ren=1, rb8=1 and areceived addresso = aprogrammed addresso when own address received, clear sm2 to receive data bytes when all data bytes have been received: set sm2 to wait for next address. su00045 figure 10. uart multiprocessor communication, automatic address recognition mode 0 is the shift register mode and sm2 is ignored. using the automatic address recognition feature allows a master to selectively communicate with one or more slaves by invoking the given slave address or addresses. all of the slaves may be contacted by using the broadcast address. two special function registers are used to define the slave's address, saddr, and the address mask, saden. saden is used to define which bits in the saddr are to b used and which bits are adon't careo. the saden mask can be logically anded with the saddr to create the agiveno address which the master will use for addressing each of the slaves. use of the given address allows multiple slaves to be recognized while excluding others. the following examples will help to show the versatility of this scheme: slave 0 saddr = 1100 0000 saden = 1111 1101 given = 1100 00x0 slave 1 saddr = 1100 0000 saden = 1111 1110 given = 1100 000x in the above example saddr is the same and the saden data is used to differentiate between the two slaves. slave 0 requires a 0 in bit 0 and it ignores bit 1. slave 1 requires a 0 in bit 1 and bit 0 is ignored. a unique address for slave 0 would be 1100 0010 since slave 1 requires a 0 in bit 1. a unique address for slave 1 would be 1100 0001 since a 1 in bit 0 will exclude slave 0. both slaves can be selected at the same time by an address which has bit 0 = 0 (for slave 0) and bit 1 = 0 (for slave 1). thus, both could be addressed with 1100 0000.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 15 in a more complex system the following could be used to select slaves 1 and 2 while excluding slave 0: slave 0 saddr = 1100 0000 saden = 1111 1001 given = 1100 0xx0 slave 1 saddr = 1110 0000 saden = 1111 1010 given = 1110 0x0x slave 2 saddr = 1110 0000 saden = 1111 1100 given = 1110 00xx in the above example the differentiation among the 3 slaves is in the lower 3 address bits. slave 0 requires that bit 0 = 0 and it can be uniquely addressed by 1110 0110. slave 1 requires that bit 1 = 0 and it can be uniquely addressed by 1110 and 0101. slave 2 requires that bit 2 = 0 and its unique address is 1110 0011. to select slaves 0 and 1 and exclude slave 2 use address 1110 0100, since it is necessary to make bit 2 = 1 to exclude slave 2. the broadcast address for each slave is created by taking the logical or of saddr and saden. zeros in this result are trended as don't-cares. in most cases, interpreting the don't-cares as ones, the broadcast address will be ff hexadecimal. upon reset saddr (sfr address 0a9h) and saden (sfr address 0b9h) are leaded with 0s. this produces a given address of all adon't careso as well as a broadcast address of all adon't careso. this effectively disables the automatic addressing mode and allows the microcontroller to use standard 80c51 type uart drivers which do not make use of this feature. timer t2 timer t2 is a 16-bit timer consisting of two registers tmh2 (high byte) and tml2 (low byte). the 16-bit timer/counter can be switched off or clocked via a prescaler from one of two sources: f osc /12 or an external signal. when timer t2 is configured as a counter, the prescaler is clocked by an external signal on t2 (p1.4). a rising edge on t2 increments the prescaler, and the maximum repetition rate is one count per machine cycle (1 mhz with a 12 mhz oscillator). the maximum repetition rate for timer t2 is twice the maximum repetition rate for timer 0 and timer 1. t2 (p1.4) is sampled at s2p1 and again at s5p1 (i.e., twice per machine cycle). a rising edge is detected when t2 is low during one sample and high during the next sample. to ensure that a rising edge is detected, the input signal must be low for at least 1/2 cycle and then high for at least 1/2 cycle. if a rising edge is detected before the end of s2p1, the timer will be incremented during the following cycle; otherwise it will be incremented one cycle later. the prescaler has a programmable division factor of 1, 2, 4, or 8 and is cleared if its division factor or input source is changed, or if the timer/counter is reset. timer t2 may be read aon the flyo but possesses no extra read latches, and software precautions may have to be taken to avoid misinterpretation in the event of an overflow from least to most significant byte while timer t2 is being read. timer t2 is not loadable and is reset by the rst signal or by a rising edge on the input signal rt2, if enabled. rt2 is enabled by setting bit t2er (tm2con.5). when the least significant byte of the timer overflows or when a 16-bit overflow occurs, an interrupt request may be generated. either or both of these overflows can be programmed to request an interrupt. in both cases, the interrupt vector will be the same. when the lower byte (tml2) overflows, flag t2b0 (tm2con) is set and flag t20v (tm2ir) is set when tmh2 overflows. these flags are set one cycle after an overflow occurs. note that when t20v is set, t2b0 will also be set. to enable the byte overflow interrupt, bits et2 (ien1.7, enable overflow interrupt, see figure 11) and t2is0 (tm2con.6, byte overflow interrupt select) must be set. bit twb0 (tm2con.4) is the timer t2 byte overflow flag. to enable the 16-bit overflow interrupt, bits et2 (ie1.7, enable overflow interrupt) and t2is1 (tm2con.7, 16-bit overflow interrupt select) must be set. bit t2ov (tm2ir.7) is the timer t2 16-bit overflow flag. all interrupt flags must be reset by software. to enable both byte and 16-bit overflow, t2is0 and t2is1 must be set and two interrupt service routines are required. a test on the overflow flags indicates which routine must be executed. for each routine, only the corresponding overflow flag must be cleared. timer t2 may be reset by a rising edge on rt2 (p1.5) if the timer t2 external reset enable bit (t2er) in t2con is set. this reset also clears the prescaler. in the idle mode, the timer/counter and prescaler are reset and halted. timer t2 is controlled by the tm2con special function register (see figure 12). timer t2 extension: when a 12 mhz oscillator is used, a 16-bit overflow on timer t2 occurs every 65.5, 131, 262, or 524 ms, depending on the prescaler division ratio; i.e., the maximum cycle time is approximately 0.5 seconds. in applications where cycle times are greater than 0.5 seconds, it is necessary to extend timer t2. this is achieved by selecting fosc/12 as the clock source (set t2ms0, reset t2ms1), setting the prescaler division ration to 1/8 (set t2p0, set t2p1), disabling the byte overflow interrupt (reset t2is0) and enabling the 16-bit overflow interrupt (set t2is1). the following software routine is written for a three-byte extension which gives a maximum cycle time of approximately 2400 hours. ovint: push acc ;save accumulator push psw ;save status inc timex1 ;increment first byte (low order) ;of extended timer mov a,timex1 jnz intex ;jump to intex if ;there is no overflow inc timex2 ;increment second byte mov a,timex2 jnz intex ;jump to intex if there is no overflow inc timex3 ;increment third byte (high order) intex: clr t2ov ;reset interrupt flag pop psw ;restore status pop acc ;restore accumulator reti ;return from interrupt timer t2, capture and compare logic: timer t2 is connected to four 16-bit capture registers and three 16-bit compare registers. a capture register may be used to capture the contents of timer t2 when a transition occurs on its corresponding input pin. a compare register may be used to set, reset, or toggle port 4 output pins at certain pre-programmable time intervals. the combination of timer t2 and the capture and compare logic is very powerful in applications involving rotating machinery, automotive injection systems, etc. timer t2 and the capture and compare logic are shown in figure 13.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 16 ect0 bit symbol function ien1.7 et2 enable timer t2 overflow interrupt(s) ien1.6 ecm2 enable t2 comparator 2 interrupt ien1.5 ecm1 enable t2 comparator 1 interrupt ien1.4 ecm0 enable t2 comparator 0 interrupt ien1.3 ect3 enable t2 capture register 3 interrupt ien1.2 ect2 enable t2 capture register 2 interrupt ien1.1 ect1 enable t2 capture register 1 interrupt ien1.0 ect0 enable t2 capture register 0 interrupt su01083 ect1 ect2 ect3 ecm0 ecm1 ecm2 et2 0 1 2 3 4 5 6 7 (lsb) (msb) ien1 (e8h) reset value = 00h figure 11. timer t2 interrupt enable register (ien1) t2ms0 bit symbol function tm2con.7 tsis1 timer t2 16-bit overflow interrupt select tm2con.6 t2is0 timer t2 byte overflow interrupt select tm2con.5 t2er timer t2 external reset enable. when this bit is set, timer t2 may be reset by a rising edge on rt2 (p1.5). tm2con.4 t2bo timer t2 byte overflow interrupt flag tm2con.3 t2p1 tm2con.2 t2p0 tm2con.1 t2ms1 tm2con.0 t2ms0 su01084 t2ms1 t2p0 t2p1 t2bo t2er t2is0 t2is1 0 1 2 3 4 5 6 7 (lsb) (msb) tm2con (eah) timer t2 prescaler select t2p1 t2p0 timer t2 clock 0 0 clock source 0 1 clock source/2 1 0 clock source/4 1 1 clock source/8 timer t2 mode select 0 0 timer t2 halted (off) 0 1 t2 clock source = f osc /12 1 0 test mode; do not use 1 1 t2 clock source = pin t2 t2ms1 t2ms0 mode selected reset value = 00h figure 12. t2 control register (tm2con)
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 17 int int ct0 ct1 ct2 ct3 cti0 int ct0i cti1 ct1i cti2 ct2i cti3 ct3i 1/12 prescaler t2 counter 8-bit overflow interrupt 16-bit overflow interrupt external reset enable off f osc t2 rt2 t2er comp cmo (s) int comp cm1 (r) int comp cm2 (t) int p4.0 p4.1 p4.2 p4.3 p4.4 p4.5 p4.6 p4.7 r r r r r r t t s s s s s s tg tg ste rte i/o port 4 s = set r = reset t = toggle tg = toggle status int tml2 = lower 8 bits tmh2 = higher 8 bits t2 sfr address: su00757 figure 13. block diagram of timer 2 capture logic: the four 16-bit capture registers that timer t2 is connected to are: ct0, ct1, ct2, and ct3. these registers are loaded with the contents of timer t2, and an interrupt is requested upon receipt of the input signals ct0i, ct1i, ct2i, or ct3i. these input signals are shared with port 1. the four interrupt flags are in the timer t2 interrupt register (tm2ir special function register). if the capture facility is not required, these inputs can be regarded as additional external interrupt inputs. using the capture control register ctcon (see figure 14), these inputs may capture on a rising edge, a falling edge, or on either a rising or falling edge. the inputs are sampled during s1p1 of each cycle. when a selected edge is detected, the contents of timer t2 are captured at the end of the cycle. measuring time intervals using capture registers: when a recurring external event is represented in the form of rising or falling edges on one of the four capture pins, the time between two events can be measured using timer t2 and a capture register. when an event occurs, the contents of timer t2 are copied into the relevant capture register and an interrupt request is generated. the interrupt service routine may then compute the interval time if it knows the previous contents of timer t2 when the last event occurred. with a 12 mhz oscillator, timer t2 can be programmed to overflow every 524 ms. when event interval times are shorter than this, computing the interval time is simple, and the interrupt service routine is short. for longer interval times, the timer t2 extension routine may be used. compare logic: each time timer t2 is incremented, the contents of the three 16-bit compare registers cm0, cm1, and cm2 are compared with the new counter value of timer t2. when a match is found, the corresponding interrupt flag in tm2ir is set at the end of the following cycle. when a match with cm0 occurs, the controller sets bits 0-5 of port 4 if the corresponding bits of the set enable register ste are at logic 1.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 18 ctp0 bit symbol capture/interrupt on: ctcon.7 ctn3 capture register 3 triggered by a falling edge on ct3i ctcon.6 ctp3 capture register 3 triggered by a rising edge on ct3i ctcon.5 ctn2 capture register 2 triggered by a falling edge on ct2i ctcon.4 ctp2 capture register 2 triggered by a rising edge on ct2i ctcon.3 ctn1 capture register 1 triggered by a falling edge on ct1i ctcon.2 ctp1 capture register 1 triggered by a rising edge on ct1i ctcon.1 ctn0 capture register 0 triggered by a falling edge on ct0i ctcon.0 ctp0 capture register 0 triggered by a rising edge on ct0i su01085 ctn1 ctp1 ctn1 ctp2 ctn2 ctp3 ctn3 0 1 2 3 4 5 6 7 (lsb) (msb) ctcon (ebh) reset value = 00h figure 14. capture control register (ctcon) when a match with cm1 occurs, the controller resets bits 0-5 of port 4 if the corresponding bits of the reset/toggle enable register rte are at logic 1 (see figure 15 for rte register function). if rte is a0o, then p4.n is not affected by a match between cm1 or cm2 and timer 2. when a match with cm2 occurs, the controller atoggleso bits 6 and 7 of port 4 if the corresponding bits of the rte are at logic 1. the port latches of bits 6 and 7 are not toggled. two additional flip-flops store the last operation, and it is these flip-flops that are toggled. thus, if the current operation is aset,o the next operation will be areseto even if the port latch is reset by software before the areseto operation occurs. the first atoggleo after a chip reset will set the port latch. the contents of these two flip-flops can be read at ste.6 and ste.7 (corresponding to p4.6 and p4.7, respectively). bits ste.6 and ste.7 are read only (see figure 16 for ste register function). a logic 1 indicates that the next toggle will set the port latch; a logic 0 indicates that the next toggle will reset the port latch. cm0, cm1, and cm2 are reset by the rst signal. the modified port latch information appears at the port pin during s5p1 of the cycle following the cycle in which a match occurred. if the port is modified by software, the outputs change during s1p1 of the following cycle. each port 4 bit can be set or reset by software at any time. a hardware modification resulting from a comparator match takes precedence over a software modification in the same cycle. when the comparator results require a aseto and a areseto at the same time, the port latch will be reset. timer t2 interrupt flag register tm2ir: eight of the nine timer t2 interrupt flags are located in special function register tm2ir (see figure 17). the ninth flag is tm2con.4. the ct0i and ct1i flags are set during s4 of the cycle in which the contents of timer t2 are captured. ct0i is scanned by the interrupt logic during s2, and ct1i is scanned during s3. ct2i and ct3i are set during s6 and are scanned during s4 and s5. the associated interrupt requests are recognized during the following cycle. if these flags are polled, a transition at ct0i or ct1i will be recognized one cycle before a transition on ct2i or ct3i since registers are read during s5. the cmi0, cmi1, and cmi2 flags are set during s6 of the cycle following a match. cmi0 is scanned by the interrupt logic during s2; cmi1 and cmi2 are scanned during s3 and s4. a match will be recognized by the interrupt logic (or by polling the flags) two cycles after the match takes place. the 16-bit overflow flag (t2ov) and the byte overflow flag (t2bo) are set during s6 of the cycle in which the overflow occurs. these flags are recognized by the interrupt logic during the next cycle. special function register ip1 (figure 17) is used to determine the timer t2 interrupt priority. setting a bit high gives that function a high priority, and setting a bit low gives the function a low priority. the functions controlled by the various bits of the ip1 register are shown in figure 17. rp40 bit symbol function rte.7 tp47 if a1o then p4.7 toggles on a match between cm1 and timer t2 rte.6 tp46 if a1o then p4.6 toggles on a match between cm1 and timer t2 rte.5 rp45 if a1o then p4.5 is reset on a match between cm1 and timer t2 rte.4 rp44 if a1o then p4.4 is reset on a match between cm1 and timer t2 rte.3 rp43 if a1o then p4.3 is reset on a match between cm1 and timer t2 rte.2 rp42 if a1o then p4.2 is reset on a match between cm1 and timer t2 rte.1 rp41 if a1o then p4.1 is reset on a match between cm1 and timer t2 rte.0 rp40 if a1o then p4.0 is reset on a match between cm1 and timer t2 su01086 ro41 rp42 rp43 rp44 rp45 tp46 tp47 0 1 2 3 4 5 6 7 (lsb) (msb) rte (efh) reset value = 00h figure 15. reset/toggle enable register (rte)
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 19 sp40 bit symbol function ste.7 tg47 toggle flip-flops ste.6 tg46 toggle flip-flops ste.5 sp45 if a1o then p4.5 is set on a match between cm0 and timer t2 ste.4 sp44 if a1o then p4.4 is set on a match between cm0 and timer t2 ste.3 sp43 if a1o then p4.3 is set on a match between cm0 and timer t2 ste.2 sp42 if a1o then p4.2 is set on a match between cm0 and timer t2 ste.1 sp41 if a1o then p4.1 is set on a match between cm0 and timer t2 ste.0 sp40 if a1o then p4.0 is set on a match between cm0 and timer t2 su01087 sp41 sp42 sp43 sp44 sp45 tg46 tg47 0 1 2 3 4 5 6 7 (lsb) (msb) ste (eeh) reset value = c0h figure 16. set enable register (ste) cti0 bit symbol function tm2ir.7 t2ov timer t2 16-bit overflow interrupt flag tm2ir.6 cmi2 cm2 interrupt flag tm2ir.5 cmi1 cm1 interrupt flag tm2ir.4 cmi0 cm0 interrupt flag tm2ir.3 cti3 ct3 interrupt flag tm2ir.2 cti2 ct2 interrupt flag tm2ir.1 cti1 ct1 interrupt flag tm2ir.0 cti0 ct0 interrupt flag su01088 cti1 cti2 cti3 cmi0 cmi1 cmi2 t2ov 0 1 2 3 4 5 6 7 (lsb) (msb) tm2ir (c8h) interrupt flag register (tm2ir) pct0 bit symbol function ip1.7 pt2 timer t2 overflow interrupt(s) priority level ip1.6 pcm2 timer t2 comparator 2 interrupt priority level ip1.5 pcm1 timer t2 comparator 1 interrupt priority level ip1.4 pcm0 timer t2 comparator 0 interrupt priority level ip1.3 pct3 timer t2 capture register 3 interrupt priority level ip1.2 pct2 timer t2 capture register 2 interrupt priority level ip1.1 pct1 timer t2 capture register 1 interrupt priority level ip1.0 pct0 timer t2 capture register 0 interrupt priority level pct1 pct2 pct3 pcm0 pcm1 pcm2 pt2 0 1 2 3 4 5 6 7 (lsb) (msb) ip1 (f8h) timer 2 interrupt priority register (ip1) reset value = 00h reset value = 00h figure 17. interrupt flag register (tm2ir) and timer t2 interrupt priority register (ip1)
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 20 timer t3, the watchdog timer in addition to timer t2 and the standard timers, a watchdog timer is also incorporated on the p87c554. the purpose of a watchdog timer is to reset the microcontroller if it enters erroneous processor states (possibly caused by electrical noise or rfi) within a reasonable period of time. an analogy is the adead man's handleo in railway locomotives. when enabled, the watchdog circuitry will generate a system reset if the user program fails to reload the watchdog timer within a specified length of time known as the awatchdog interval.o watchdog circuit description: the watchdog timer (timer t3) consists of an 8-bit timer with an 11-bit prescaler as shown in figure 18. the prescaler is fed with a signal whose frequency is 1/12 the oscillator frequency (1 mhz with a 12 mhz oscillator). the 8-bit timer is incremented every ato seconds, where: t = 12 2048 1/f osc (= 1.5 ms at f osc = 16 mhz; = 1 ms at f osc = 24 mhz) if the 8-bit timer overflows, a short internal reset pulse is generated which will reset the p87c554. a short output reset pulse is also generated at the rst pin. this short output pulse (3 machine cycles) may be destroyed if the rst pin is connected to a capacitor. this would not, however, affect the internal reset operation. watchdog operation is activated when external pin ew is tied low. when ew is tied low, it is impossible to disable the watchdog operation by software. how to operate the watchdog timer: the watchdog timer has to be reloaded within periods that are shorter than the programmed watchdog interval; otherwise the watchdog timer will overflow and a system reset will be generated. the user program must therefore continually execute sections of code which reload the watchdog timer. the period of time elapsed between execution of these sections of code must never exceed the watchdog interval. when using a 16 mhz oscillator, the watchdog interval is programmable between 1.5 ms and 392 ms. when using a 24 mhz oscillator, the watchdog interval is programmable between 1 ms and 255 ms. in order to prepare software for watchdog operation, a programmer should first determine how long his system can sustain an erroneous processor state. the result will be the maximum watchdog interval. as the maximum watchdog interval becomes shorter, it becomes more difficult for the programmer to ensure that the user program always reloads the watchdog timer within the watchdog interval, and thus it becomes more difficult to implement watchdog operation. the programmer must now partition the software in such a way that reloading of the watchdog is carried out in accordance with the above requirements. the programmer must determine the execution times of all software modules. the effect of possible conditional branches, subroutines, external and internal interrupts must all be taken into account. since it may be very difficult to evaluate the execution times of some sections of code, the programmer should use worst case estimations. in any event, the programmer must make sure that the watchdog is not activated during normal operation. the watchdog timer is reloaded in two stages in order to prevent erroneous software from reloading the watchdog. first pcon.4 (wle) must be set. the t3 may be loaded. when t3 is loaded, pcon.4 (wle) is automatically reset. t3 cannot be loaded if pcon.4 (wle) is reset. reload code may be put in a subroutine as it is called frequently. since timer t3 is an up-counter, a reload value of 00h gives the maximum watchdog interval (510 ms with a 12 mhz oscillator), and a reload value of 0ffh gives the minimum watchdog interval (2 ms with a 12 mhz oscillator). in the idle mode, the watchdog circuitry remains active. when watchdog operation is implemented, the power-down mode cannot be used since both states are contradictory. thus, when watchdog operation is enabled by tying external pin ew low, it is impossible to enter the power-down mode, and an attempt to set the power-down bit (pcon.1) will have no effect. pcon.1 will remain at logic 0. internal bus timer t3 (8-bit) load loaden prescaler (11-bit) clear f osc /6 ew wle clear pd loaden rst r rst v dd p internal reset internal bus write t3 pcon.4 pcon.1 overflow su00955 figure 18. watchdog timer
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 21 during the early stages of software development/debugging, the watchdog may be disabled by tying the ew pin high. at a later stage, ew may be tied low to complete the debugging process. watchdog software example: the following example shows how watchdog operation might be handled in a user program. ;at the program start: t3 equ 0ffh ;address of watchdog timer t3 pcon equ 087h ;address of pcon sfr watch-intv equ 156 ;watchdog interval (e.g., 2x100 ms) ;to be inserted at each watchdog reload location within ;the user program: lcall watchdog ;watchdog service routine: watchdog: orl pcon,#10h ;set condition flag (pcon.4) mov t3,watch-inv ;load t3 with watchdog interval ret if it is possible for this subroutine to be called in an erroneous state, then the condition flag wle should be set at different parts of the main program. serial i/o the p87c554 is equipped with two independent serial ports: sio0 and sio1. sio0 is a full duplex uart port and is similar to the enhanced uart serial port. sio1 accommodates the i 2 c bus. sio0: sio0 is a full duplex serial i/o port identical to that of the enhanced uart except time 2 cannot be used as a baud rate generator. its operation is the same, including the use of timer 1 as a baud rate generator. port 5 operation port 5 may be used to input up to 8 analog signals to the adc. unused adc inputs may be used to input digital inputs. these inputs have an inherent hysteresis to prevent the input logic from drawing excessive current from the power lines when driven by analog signals. channel to channel crosstalk (ct) should be taken into consideration when both analog and digital signals are simultaneously input to port 5 (see, d.c. characteristics in data sheet). port 5 is not bidirectional and may not be configured as an output port. all six ports are multifunctional, and their alternate functions are listed in the pin descriptions section of this datasheet. pulse width modulated outputs the p87c554 contains two pulse width modulated output channels (see figure 19). these channels generate pulses of programmable length and interval. the repetition frequency is defined by an 8-bit prescaler pwmp, which supplies the clock for the counter. the prescaler and counter are common to both pwm channels. the 8-bit counter counts modulo 255, i.e., from 0 to 254 inclusive. the value of the 8-bit counter is compared to the contents of two registers: pwm0 and pwm1. provided the contents of either of these registers is greater than the counter value, the corresponding pwm0 or pwm1 output is set low. if the contents of these registers are equal to, or less than the counter value, the output will be high. the pulse-width-ratio is therefore defined by the contents of the registers pwm0 and pwm1. the pulse-width-ratio is in the range of 0 to 1 and may be programmed in increments of 1/255. buffered pwm outputs may be used to drive dc motors. the rotation speed of the motor would be proportional to the contents of pwmn. the pwm outputs may also be configured as a dual dac. in this application, the pwm outputs must be integrated using conventional operational amplifier circuitry. if the resulting output voltages have to be accurate, external buffers with their own analog supply should be used to buffer the pwm outputs before they are integrated. the repetition frequency f pwm , at the pwmn outputs is give by: f pwm  f osc 2 (1  pwmp) 255 this gives a repetition frequency range of 123hz to 31.4khz (f osc = 16 mhz). at fosc = 24 mhz, the frequency range is 184hz to 47.1hz. by loading the pwm registers with either 00h or ffh, the pwm channels will output a constant high or low level, respectively. since the 8-bit counter counts modulo 255, it can never actually reach the value of the pwm registers when they are loaded with ffh. when a compare register (pwm0 or pwm1) is loaded with a new value, the associated output is updated immediately. it does not have to wait until the end of the current counter period. both pwmn output pins are driven by push-pull drivers. these pins are not used for any other purpose. prescaler frequency control register pwmp reset value = 00h pwmp (feh) 76 5 432 10 msb lsb pwmp.0-7 prescaler division factor = pwmp + 1. reading pwmp gives the current reload value. the actual count of the prescaler cannot be read. reset value = 00h p wm0 (fch) pwm1 (fdh) 76 5 43 2 10 msb lsb pwm0/1.0-7} low/high ratio of pwmn  (pwmn) 255  (pwmn) analog-to-digital converter the analog input circuitry consists of an 8-input analog multiplexer and a 10-bit, straight binary, successive approximation adc. the a/d can also be operated in 8-bit mode with faster conversion times by setting bit adc8 (auxr1.7). the 8-bit results will be contained in the adch register. the analog reference voltage and analog power supplies are connected via separate input pins. for 10-bit accuracy, the conversion takes 50 machine cycles, i.e., 37.5 m s at an oscillator frequency of 16 mhz, 25 m s at an oscillator frequency of 24 mhz. for the 8-bit mode, the conversion takes 24 machine cycles. input voltage swing is from 0 v to +5 v. because the internal dac employs a ratiometric potentiometer, there are no discontinuities in the converter characteristic. figure 20 shows a functional diagram of the analog input circuitry. the adc has the option of either being powered off in idle mode for reduced power consumption or being active in idle mode for reducing internal noise during the conversion. this option is selected by the aidl bit of auxr1 register (auxr1.6). with the aidl bit set, the adc is active in the idle mode, and with the aidl bit cleared, the adc is powered off in idle mode.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 22 internal bus pwm0 f osc 8-bit comparator 8-bit counter 8-bit comparator pwm1 prescaler output buffer pwmp output buffer pwm0 pwm1 su00956 1/2 figure 19. functional diagram of pulse width modulated outputs internal bus 10-bit a/d converter analog input multiplexer 01234567 01234567 + stadc analog ref. analog supply analog ground adc0 adc1 adc2 adc3 adc4 adc5 adc6 adc7 adcon adch su00957 figure 20. functional diagram of analog input circuitry 10-bit analog-to-digital conversion: figure 21 shows the elements of a successive approximation (sa) adc. the adc contains a dac which converts the contents of a successive approximation register to a voltage (vdac) which is compared to the analog input voltage (vin). the output of the comparator is fed to the successive approximation control logic which controls the successive approximation register. a conversion is initiated by setting adcs in the adcon register. adcs can be set by software only or by either hardware or software. the software only start mode is selected when control bit adcon.5 (adex) = 0. a conversion is then started by setting control bit adcon.3 (adcs). the hardware or software start mode is selected when adcon.5 = 1, and a conversion may be started by setting adcon.3 as above or by applying a rising edge to external pin stadc. when a conversion is started by applying a rising edge, a low level must be applied to stadc for at least one machine cycle followed by a high level for at least one machine cycle.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 23 successive approximation control logic successive approximation register dac + start stop v in v dac 01 234 56 t/tau v dac full scale 1 v in 1/2 3/4 7/8 15/16 29/32 59/64 su00958 figure 21. successive approximation adc the low-to-high transition of stadc is recognized at the end of a machine cycle, and the conversion commences at the beginning of the next cycle. when a conversion is initiated by software, the conversion starts at the beginning of the machine cycle which follows the instruction that sets adcs. adcs is actually implemented with two flip-flops: a command flip-flop which is affected by set operations, and a status flag which is accessed during read operations. the next two machine cycles are used to initiate the converter. at the end of the first cycle, the adcs status flag is set and a value of a1o will be returned if the adcs flag is read while the conversion is in progress. sampling of the analog input commences at the end of the second cycle. during the next eight machine cycles, the voltage at the previously selected pin of port 5 is sampled, and this input voltage should be stable in order to obtain a useful sample. in any event, the input voltage slew rate must be less than 10v/ms in order to prevent an undefined result. the successive approximation control logic first sets the most significant bit and clears all other bits in the successive approximation register (10 0000 0000b). the output of the dac (50% full scale) is compared to the input voltage vin. if the input voltage is greater than vdac, then the bit remains set; otherwise it is cleared. the successive approximation control logic now sets the next most significant bit (11 0000 0000b or 01 0000 0000b, depending on the previous result), and vdac is compared to vin again. if the input voltage is greater than vdac, then the bit being tested remains set; otherwise the bit being tested is cleared. this process is repeated until all ten bits have been tested, at which stage the result of the conversion is held in the successive approximation register. figure 22 shows a conversion flow chart. the bit pointer identifies the bit under test. the conversion takes four machine cycles per bit. the end of the 10-bit conversion is flagged by control bit adcon.4 (adci). the upper 8 bits of the result are held in special function register adch, and the two remaining bits are held in adcon.7 (adc.1) and adcon.6 (adc.0). the user may ignore the two least significant bits in adcon and use the adc as an 8-bit converter (8 upper bits in adch). in any event, the total actual conversion time is 50 machine cycles for the 8xc552 or 24 machine cycles for the 8xc562. adci will be set and the adcs status flag will be reset 50 (or 24) cycles after the command flip-flop (adcs) is set. control bits adcon.0, adcon.1, and adcon.2 are used to control an analog multiplexer which selects one of eight analog channels (see figure 23). an adc conversion in progress is unaffected by an external or software adc start. the result of a completed conversion remains unaffected provided adci = logic 1; a new adc conversion already in progress is aborted when the idle or power-down mode is entered. the result of a completed conversion (adci = logic 1) remains unaffected when entering the idle mode.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 24 eoc soc reset sar start of conversion end of conversion [bit pointer] = msb [bit] n = 1 conversion time test complete [bit] n = 0 [bit pointer] + 1 test bit pointer 10 end end su00959 figure 22. a/d conversion flowchart
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 25 (msb) (lsb) aadr2 aadr1 aadr0 7654321 0 adcon (c5h) adcon.7 adc.1 bit 1 of adc result bit 0 of adc result enable external start of conversion by stadc 0 = conversion can be started by software only (by setting adcs) 1 = conversion can be started by software or externally (by a rising edge on stadc) bit symbol function adex adci adcs adc.1 adc.0 adcon.6 adc.0 adcon.5 adex adc interrupt flag: this flag is set when an a/d conversion result is ready to be read. an interrupt is invoked if it is enabled. the flag may be cleared by the interrupt service routine. while this flag is set, the adc cannot start a new conversion. adci cannot be set by software. adcon.4 adci adc start and status: setting this bit starts an a/d conversion. it may be set by software or by the external signal stadc. the adc logic ensures that this signal is high while the adc is busy. on completion of the conversion, adcs is reset immediately after the interrupt flag has been set. adcs cannot be reset by software. a new conversion may not be started while either adcs or adci is high. adcon.3 adcs adci adcs adc status 0 0 adc not busy; a conversion can be started 0 1 adc busy; start of a new conversion is blocked 1 0 conversion completed; start of a new conversion requires adci=0 1 1 conversion completed; start of a new conversion requires adci=0 adcon.2 aadr2 adcon.1 aadr1 adcon.0 aadr0 analogue input select: this binary coded address selects one of the eight analogue port bits of p5 to be input to the converter. it can only be changed when adci and adcs are both low. aadr2 aadr1 selected analog channel 0 0 adc0 (p5.0) 0 0 adc1 (p5.1) aadr0 0 1 0 1 adc2 (p5.2) 0 0 1 adc3 (p5.3) 1 1 0 adc4 (p5.4) 0 1 0 adc5 (p5.5) 1 1 1 adc6 (p5.6) 0 1 1 adc7 (p5.7) 1 if adci is cleared by software while adcs is set at the same time, a new a/d conversion with the same channel number may be started. but it is recommended to reset adci before adcs is set. su00960 reset value = xx00 0000b figure 23. adc control register (adcon)
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 26 10-bit adc resolution and analog supply: figure 24 shows how the adc is realized. the adc has its own supply pins (av dd and av ss ) and two pins (vref+ and vref) connected to each end of the dac's resistance-ladder. the ladder has 1023 equally spaced taps, separated by a resistance of aro. the first tap is located 0.5 x r above vref, and the last tap is located 1.5 x r below vref+. this gives a total ladder resistance of 1024 x r. this structure ensures that the dac is monotonic and results in a symmetrical quantization error as shown in figure 26. for input voltages between vref and (vref) + 1/2 lsb, the 10-bit result of an a/d conversion will be 00 0000 0000b = 000h. for input voltages between (vref+) 3/2 lsb and vref+, the result of a conversion will be 11 1111 1111b = 3ffh. avref+ and avref may be between av dd + 0.2 v and av ss 0.2 v. avref+ should be positive with respect to avref, and the input voltage (vin) should be between avref+ and avref. if the analog input voltage range is from 2 v to 4 v, then 10-bit resolution can be obtained over this range if avref+ = 4v and avref = 2 v. the result can always be calculated from the following formula: result  1024 v in  av ref  av ref   av ref  power reduction modes the p87c554 has two reduced power modes of operation: the idle mode and the power-down mode. these modes are entered by setting bits in the pcon special function register. when the p87c554 enters the idle mode, the following functions are disabled: cpu (halted) timer t2 (halted and reset) pwm0, pwm1 (reset; outputs are high) adc (may be enabled for operation in idle mode by setting bit aidc (auxr1.6) ). in idle mode, the following functions remain active: timer 0 timer 1 timer t3 sio0 sio1 external interrupts when the p87c554 enters the power-down mode, the oscillator is stopped. the power-down mode is entered by setting the pd bit in the pcon register. the pd bit can only be set if the ew input is tied high. successive approximation control logic successive approximation register + decoder msb comparator lsb start ready av ref+ av ref r/2 r r r r r r/2 total resistance = 1023r + 2 x r/ = 1024r v ref v in 1023 1022 1021 3 2 1 0 value 0000 0000 00 is output for voltages v ref to (v ref + 1/2 lsb) value 1111 1111 11 is output for voltages (v ref+ 3/2 lsb) to v ref+ su00961 figure 24. adc realization
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 27 r s v analog input c s c c to comparator + i n i n+1 sm n+1 sm n rm n+1 rm n multiplexer rm = 0.5 - 3 k w c s + c c = 15 pf maximum r s = recommended < 9.6 k w for 1 lsb @ 12 mhz note: because the analog to digital converter has a sampled-data comparator, the input looks capacitive to a source. when a conversio n is initiated, switch sm closes for 8t cy (8 m s @ 12 mhz crystal frequency) during which time capacitance c s + c c is charged. it should be noted that the sampling causes the analog input to present a varying load to an analog source. su00962 figure 25. a/d input: equivalent circuit 0 q 2q 3q 4q 5q v in code out 100 000 001 010 011 101 quantization error q = lsb = 5 mv v in v digital + q/2 q/2 v in symmetrical quantization error su00963 figure 26. effective conversion characteristic
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 28 interrupts the p87c554 has fifteen interrupt sources, each of which can be assigned one of four priority levels. the five interrupt sources common to the 80c51 are the external interrupts (int0 and int1 ), the timer 0 and timer 1 interrupts (it0 and it1), and the serial i/o interrupt (ri or ti). in the p87c554, the standard serial interrupt is called sio0. the eight timer t2 interrupts are generated by flags cti0-ct13, cmi0-cmi2, and by the logical or of flags t2ov and t2bo. flags cti0 to ct13 are set by input signals ct0i to ct3i. flags cmi0 to cmi2 are set when a match occurs between timer t2 and the compare registers cm0, cm1, and cm2. when an 8-bit or 16-bit overflow occurs, flags t2bo and t2ov are set, respectively. these nine flags are not cleared by hardware and must be reset by software to avoid recurring interrupts. the adc interrupt is generated by the adci flag in the adc control register (adcon). this flag is set when an adc conversion result is ready to be read. adci is not cleared by hardware and must be reset by software to avoid recurring interrupts. the sio1 (i 2 c) interrupt is generated by the si flag in the sio1 control register (s1con). this flag is set when s1sta is loaded with a valid status code. the adci flag may be reset by software. it cannot be set by software. all other flags that generate interrupts may be set or cleared by software, and the effect is the same as setting or resetting the flags by hardware. thus, interrupts may be generated by software and pending interrupts can be canceled by software. interrupt enable registers: each interrupt source can be individually enabled or disabled by setting or clearing a bit in the interrupt enable special function registers ien0 and ien1. all interrupt sources can also be globally enabled or disabled by setting or clearing bit ea in ien0. the interrupt enable registers are described in figures 27 and 28. there are 3 sfrs associated with each of the four-level interrupts. they are the ienx, ipx, and ipxh. (see figures 29, 30, and 31.) the ipxh (interrupt priority high) register makes the four-level interrupt structure possible. the function of the ipxh sfr is simple and when combined with the ipx sfr determines the priority of each interrupt. the priority of each interrupt is determined as shown in the following table: priority bits interrupt priority level ipxh.x ipx.x interrupt priority level 0 0 level 0 (lowest priority) 0 1 level 1 1 0 level 2 1 1 level 3 (highest priority) the priority scheme for servicing the interrupts is the same as that for the 80c51, except there are four interrupt levels rather than two as on the 80c51. an interrupt will be serviced as long as an interrupt of equal or higher priority is not already being serviced. if an interrupt of equal or higher level priority is being serviced, the new interrupt will wait until it is finished before being serviced. if a lower priority level interrupt is being serviced, it will be stopped and the new interrupt serviced. when the new interrupt is finished, the lower priority level interrupt that was stopped will be completed. ex0 bit symbol function ien0.7 ea global enable/disable control 0 = no interrupt is enabled 1 = any individually enabled interrupt will be accepted ien0.6 ead eanble adc interrupt ien0.5 es1 enable sio1 (i 2 c) interrupt ien0.4 es0 enable sio0 (uart) interrupt ien0.3 et1 enable timer 1 interrupt ien0.2 ex1 enable external interrupt 1 ien0.1 et0 enable timer 0 interrupt ien0.0 ex0 enable external interrupt 0 su00762 et0 ex1 et1 es0 es1 ead ea 0 1 2 3 4 5 6 7 (lsb) (msb) ien0 (a8h) figure 27. interrupt enable register (ien0)
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 29 ect0 bit symbol function ien1.7 et2 enable timer t2 overflow interrupt(s) ien1.6 ecm2 enable t2 comparator 2 interrupt ien1.5 ecm1 enable t2 comparator 1 interrupt ien1.4 ecm0 enable t2 comparator 0 interrupt ien1.3 ect3 enable t2 capture register 3 interrupt ien1.2 ect2 enable t2 capture register 2 interrupt ien1.1 ect1 enable t2 capture register 1 interrupt ien1.0 ect0 enable t2 capture register 0 interrupt su00755 ect1 ect2 ect3 ecm0 ecm1 ecm2 et2 0 1 2 3 4 5 6 7 (lsb) (msb) ien1 (e8h) in all cases, if the enable bit is 0, then the interrupt is disabled, and if the enable bit is 1, then the interrupt is enabled . figure 28. interrupt enable register (ien1) px0 bit symbol function ip0.7 unused ip0.6 pad adc interrupt priority level ip0.5 ps1 sio1 (i 2 c) interrupt priority level ip0.4 ps0 sio0 (uart) interrupt priority level ip0.3 pt1 timer 1 interrupt priority level ip0.2 px1 external interrupt 1 priority level ip0.1 pt0 timer 0 interrupt priority level ip0.0 px0 external interrupt 0 priority level su00763 pt0 px1 pt1 ps0 ps1 pad 0 1 2 3 4 5 6 7 (lsb) (msb) ip0 (b8h) figure 29. interrupt priority register (ip0) px0h bit symbol function ip0h.7 unused ip0h.6 padh adc interrupt priority level high ip0h.5 ps1h sio1 (i 2 c) interrupt priority level high ip0h.4 ps0h sio0 (uart) interrupt priority level high ip0h.3 pt1h timer 1 interrupt priority level high ip0h.2 px1h external interrupt 1 priority level high ip0h.1 pt0h timer 0 interrupt priority level high ip0h.0 px0h external interrupt 0 priority level high su00983 pt0h px1h pt1h ps0h ps1h padh 0 1 2 3 4 5 6 7 (lsb) (msb) ip0h (b7h) figure 30. interrupt priority register high (ip0h)
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 30 pct0 bit symbol function ip1.7 pt2 t2 overflow interrupt(s) priority level ip1.6 pcm2 t2 comparator 2 interrupt priority level ip1.5 pcm1 t2 comparator 1 interrupt priority level ip1.4 pcm0 t2 comparator 0 interrupt priority level ip1.3 pct3 t2 capture register 3 interrupt priority level ip1.2 pct2 t2 capture register 2 interrupt priority level ip1.1 pct1 t2 capture register 1 interrupt priority level ip1.0 pct0 t2 capture register 0 interrupt priority level su00764 pct1 pct2 pct3 pcm0 pcm1 pcm2 pt2 0 1 2 3 4 5 6 7 (lsb) (msb) ip1 (f8h) figure 31. interrupt priority register (ip1) pct0h bit symbol function ip1h.7 pt2h t2 overflow interrupt(s) priority level high ip1h.6 pcm2h t2 comparator 2 interrupt priority level high ip1h.5 pcm1h t2 comparator 1 interrupt priority level high ip1h.4 pcm0h t2 comparator 0 interrupt priority level high ip1h.3 pct3h t2 capture register 3 interrupt priority level high ip1h.2 pct2h t2 capture register 2 interrupt priority level high ip1h.1 pct1h t2 capture register 1 interrupt priority level high ip1h.0 pct0h t2 capture register 0 interrupt priority level high su00984 pct1h pct2h pct3h pcm0h pcm1h pcm2h pt2h 0 1 2 3 4 5 6 7 (lsb) (msb) ip1h (f7h) figure 32. interrupt priority register high (ip1h) table 3. interrupt priority structure source name priority within level external interrupt 0 x0 (highest) sio1 (i 2 c) s1 adc completion adc timer 0 overflow t0 t2 capture 0 ct0 t2 compare 0 cm0 external interrupt 1 x1 t2 capture 1 ct1 t2 compare 1 cm1 timer 1 overflow t1 t2 capture 2 ct2 t2 compare 2 cm2 sio0 (uart) s0 t2 capture 3 ct3 timer t2 overflow t2 (lowest) table 4. interrupt vector addresses source name vector address external interrupt 0 x0 0003h timer 0 overflow t0 000bh external interrupt 1 x1 0013h timer 1 overflow t1 001bh sio0 (uart) s0 0023h sio1 (i 2 c) s1 002bh t2 capture 0 ct0 0033h t2 capture 1 ct1 003bh t2 capture 2 ct2 0043h t2 capture 3 ct3 004bh adc completion adc 0053h t2 compare 0 cm0 005bh t2 compare 1 cm1 0063h t2 compare 2 cm2 006bh t2 overflow t2 0073h
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 31 sio1, i 2 c serial i/o: the i 2 c bus uses two wires (sda and scl) to transfer information between devices connected to the bus. the main features of the bus are: bidirectional data transfer between masters and slaves multimaster bus (no central master) arbitration between simultaneously transmitting masters without corruption of serial data on the bus serial clock synchronization allows devices with different bit rates to communicate via one serial bus serial clock synchronization can be used as a handshake mechanism to suspend and resume serial transfer the i 2 c bus may be used for test and diagnostic purposes the output latches of p1.6 and p1.7 must be set to logic 1 in order to enable sio1. the p87c554 on-chip i 2 c logic provides a serial interface that meets the i 2 c bus specification and supports all transfer modes (other than the low-speed mode) from and to the i 2 c bus. the sio1 logic handles bytes transfer autonomously. it also keeps track of serial transfers, and a status register (s1sta) reflects the status of sio1 and the i 2 c bus. the cpu interfaces to the i 2 c logic via the following four special function registers: s1con (sio1 control register), s1sta (sio1 status register), s1dat (sio1 data register), and s1adr (sio1 slave address register). the sio1 logic interfaces to the external i 2 c bus via two port 1 pins: p1.6/scl (serial clock line) and p1.7/sda (serial data line). a typical i 2 c bus configuration is shown in figure 33, and figure 34 shows how a data transfer is accomplished on the bus. depending on the state of the direction bit (r/w), two types of data transfers are possible on the i 2 c bus: 1. data transfer from a master transmitter to a slave receiver. the first byte transmitted by the master is the slave address. next follows a number of data bytes. the slave returns an acknowledge bit after each received byte. 2. data transfer from a slave transmitter to a master receiver. the first byte (the slave address) is transmitted by the master. the slave then returns an acknowledge bit. next follows the data bytes transmitted by the slave to the master. the master returns an acknowledge bit after all received bytes other than the last byte. at the end of the last received byte, a anot acknowledgeo is returned. the master device generates all of the serial clock pulses and the start and stop conditions. a transfer is ended with a stop condition or with a repeated start condition. since a repeated start condition is also the beginning of the next serial transfer, the i 2 c bus will not be released. modes of operation: the on-chip sio1 logic may operate in the following four modes: 1. master transmitter mode: serial data output through p1.7/sda while p1.6/scl outputs the serial clock. the first byte transmitted contains the slave address of the receiving device (7 bits) and the data direction bit. in this case the data direction bit (r/w ) will be logic 0, and we say that a awo is transmitted. thus the first byte transmitted is sla+w. serial data is transmitted 8 bits at a time. after each byte is transmitted, an acknowledge bit is received. start and stop conditions are output to indicate the beginning and the end of a serial transfer. 2. master receiver mode: the first byte transmitted contains the slave address of the transmitting device (7 bits) and the data direction bit. in this case the data direction bit (r/w ) will be logic 1, and we say that an aro is transmitted. thus the first byte transmitted is sla+r. serial data is received via p1.7/sda while p1.6/scl outputs the serial clock. serial data is received 8 bits at a time. after each byte is received, an acknowledge bit is transmitted. start and stop conditions are output to indicate the beginning and end of a serial transfer. 3. slave receiver mode: serial data and the serial clock are received through p1.7/sda and p1.6/scl. after each byte is received, an acknowledge bit is transmitted. start and stop conditions are recognized as the beginning and end of a serial transfer. address recognition is performed by hardware after reception of the slave address and direction bit. 4. slave transmitter mode: the first byte is received and handled as in the slave receiver mode. however, in this mode, the direction bit will indicate that the transfer direction is reversed. serial data is transmitted via p1.7/sda while the serial clock is input through p1.6/scl. start and stop conditions are recognized as the beginning and end of a serial transfer. in a given application, sio1 may operate as a master and as a slave. in the slave mode, the sio1 hardware looks for its own slave address and the general call address. if one of these addresses is detected, an interrupt is requested. when the microcontroller wishes to become the bus master, the hardware waits until the bus is free before the master mode is entered so that a possible slave action is not interrupted. if bus arbitration is lost in the master mode, sio1 switches to the slave mode immediately and can detect its own slave address in the same serial transfer.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 32 v dd other device with i 2 c interface p87c554 other device with i 2 c interface p1.7/sda p1.6/scl sda scl i 2 c bus r p r p su01650 figure 33. typical i 2 c bus configuration scl start condition s sda p/s msb acknowledgment signal from receiver clock line held low while interrupts are serviced 1 2 7 8 9 1 2 38 ack 9 ack repeated if more bytes are transferred acknowledgment signal from receiver slave address r/w direction bit stop condition repeated start condition su00965 figure 34. data transfer on the i 2 c bus sio1 implementation and operation: figure 35 shows how the on-chip i 2 c bus interface is implemented, and the following text describes the individual blocks. i nput f ilters and o utput s tages the input filters have i 2 c compatible input levels. if the input voltage is less than 1.5 v, the input logic level is interpreted as 0; if the input voltage is greater than 3.0 v, the input logic level is interpreted as 1. input signals are synchronized with the internal clock (f osc /4), and spikes shorter than three oscillator periods are filtered out. the output stages consist of open drain transistors that can sink 3ma at v out < 0.4 v. these open drain outputs do not have clamping diodes to v dd . thus, if the device is connected to the i 2 c bus and v dd is switched off, the i 2 c bus is not affected. a ddress r egister, s 1 adr this 8-bit special function register may be loaded with the 7-bit slave address (7 most significant bits) to which sio1 will respond when programmed as a slave transmitter or receiver. the lsb (gc) is used to enable general call address (00h) recognition. c omparator the comparator compares the received 7-bit slave address with its own slave address (7 most significant bits in s1adr). it also compares the first received 8-bit byte with the general call address (00h). if an equality is found, the appropriate status bits are set and an interrupt is requested. s hift r egister, s 1 dat this 8-bit special function register contains a byte of serial data to be transmitted or a byte which has just been received. data in s1dat is always shifted from right to left; the first bit to be transmitted is the msb (bit 7) and, after a byte has been received, the first bit of received data is located at the msb of s1dat. while data is being shifted out, data on the bus is simultaneously being shifted in; s1dat always contains the last byte present on the bus. thus, in the event of lost arbitration, the transition from master transmitter to slave receiver is made with the correct data in s1dat.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 33 f osc /4 internal bus address register comparator shift register control register status register arbitration & sync logic timing & control logic serial clock generator ack status decoder timer 1 overflow interrupt 8 8 8 8 s1sta status bits s1con s1dat input filter output stage p1.7 input filter output stage p1.6 p1.6/scl p1.7/sda s1adr su00966 figure 35. i 2 c bus serial interface block diagram
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 34 a rbitration and s ynchronization l ogic in the master transmitter mode, the arbitration logic checks that every transmitted logic 1 actually appears as a logic 1 on the i 2 c bus. if another device on the bus overrules a logic 1 and pulls the sda line low, arbitration is lost, and sio1 immediately changes from master transmitter to slave receiver. sio1 will continue to output clock pulses (on scl) until transmission of the current serial byte is complete. arbitration may also be lost in the master receiver mode. loss of arbitration in this mode can only occur while sio1 is returning a anot acknowledge: (logic 1) to the bus. arbitration is lost when another device on the bus pulls this signal low. since this can occur only at the end of a serial byte, sio1 generates no further clock pulses. figure 36 shows the arbitration procedure. the synchronization logic will synchronize the serial clock generator with the clock pulses on the scl line from another device. if two or more master devices generate clock pulses, the amarko duration is determined by the device that generates the shortest amarks,o and the aspaceo duration is determined by the device that generates the longest aspaces.o figure 37 shows the synchronization procedure. a slave may stretch the space duration to slow down the bus master. the space duration may also be stretched for handshaking purposes. this can be done after each bit or after a complete byte transfer. sio1 will stretch the scl space duration after a byte has been transmitted or received and the acknowledge bit has been transferred. the serial interrupt flag (si) is set, and the stretching continues until the serial interrupt flag is cleared. ack 1. another device transmits identical serial data. sda 1 234 89 scl (1) (1) (2) (3) 2. another device overrules a logic 1 (dotted line) transmitted by sio1 (master) by pulling the sda line low. arbitration is lost, and sio1 enters the slave receiver mode. 3. sio1 is in the slave receiver mode but still generates clock pulses until the current byte has been transmitted. sio1 will not generate clock pulses for the next byte. data on sda originates from the new master once it has won arbitration. su00967 figure 36. arbitration procedure (1) scl (3) (1) sda mark duration space duration (2) 1. another service pulls the scl line low before the sio1 amarko duration is complete. the serial clock generator is immediately reset and commences with the aspaceo duration by pulling scl low. 2. another device still pulls the scl line low after sio1 releases scl. the serial clock generator is forced into the wait state until the scl line is released. 3. the scl line is released, and the serial clock generator commences with the mark duration. su00968 figure 37. serial clock synchronization
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 35 s erial c lock g enerator this programmable clock pulse generator provides the scl clock pulses when sio1 is in the master transmitter or master receiver mode. it is switched off when sio1 is in a slave mode. the programmable output clock frequencies are: f osc /120, f osc /9600, and the timer 1 overflow rate divided by eight. the output clock pulses have a 50% duty cycle unless the clock generator is synchronized with other scl clock sources as described above. t iming and c ontrol the timing and control logic generates the timing and control signals for serial byte handling. this logic block provides the shift pulses for s1dat, enables the comparator, generates and detects start and stop conditions, receives and transmits acknowledge bits, controls the master and slave modes, contains interrupt request logic, and monitors the i 2 c bus status. c ontrol r egister, s 1 con this 7-bit special function register is used by the microcontroller to control the following sio1 functions: start and restart of a serial transfer, termination of a serial transfer, bit rate, address recognition, and acknowledgment. s tatus d ecoder and s tatus r egister the status decoder takes all of the internal status bits and compresses them into a 5-bit code. this code is unique for each i 2 c bus status. the 5-bit code may be used to generate vector addresses for fast processing of the various service routines. each service routine processes a particular bus status. there are 26 possible bus states if all four modes of sio1 are used. the 5-bit status code is latched into the five most significant bits of the status register when the serial interrupt flag is set (by hardware) and remains stable until the interrupt flag is cleared by software. the three least significant bits of the status register are always zero. if the status code is used as a vector to service routines, then the routines are displaced by eight address locations. eight bytes of code is sufficient for most of the service routines (see the software example in this section). the four sio1 special function registers: the microcontroller interfaces to sio1 via four special function registers. these four sfrs (s1adr, s1dat, s1con, and s1sta) are described individually in the following sections. the address register, s1adr: the cpu can read from and write to this 8-bit, directly addressable sfr. s1adr is not affected by the sio1 hardware. the contents of this register are irrelevant when sio1 is in a master mode. in the slave modes, the seven most significant bits must be loaded with the microcontroller's own slave address, and, if the least significant bit is set, the general call address (00h) is recognized; otherwise it is ignored. s1adr (dbh) xgc 7 65 432 10 own slave address x xx xx x the most significant bit corresponds to the first bit received from the i 2 c bus after a start condition. a logic 1 in s1adr corresponds to a high level on the i 2 c bus, and a logic 0 corresponds to a low level on the bus. the data register, s1dat: s1dat contains a byte of serial data to be transmitted or a byte which has just been received. the cpu can read from and write to this 8-bit, directly addressable sfr while it is not in the process of shifting a byte. this occurs when sio1 is in a defined state and the serial interrupt flag is set. data in s1dat remains stable as long as si is set. data in s1dat is always shifted from right to left: the first bit to be transmitted is the msb (bit 7), and, after a byte has been received, the first bit of received data is located at the msb of s1dat. while data is being shifted out, data on the bus is simultaneously being shifted in; s1dat always contains the last data byte present on the bus. thus, in the event of lost arbitration, the transition from master transmitter to slave receiver is made with the correct data in s1dat. s1dat (dah) sd7 sd6 sd5 sd4 sd3 sd2 sd1 sd0 7 65 43 2 1 0 shift direction sd7 - sd0: eight bits to be transmitted or just received. a logic 1 in s1dat corresponds to a high level on the i 2 c bus, and a logic 0 corresponds to a low level on the bus. serial data shifts through s1dat from right to left. figure 38 shows how data in s1dat is serially transferred to and from the sda line. s1dat and the ack flag form a 9-bit shift register which shifts in or shifts out an 8-bit byte, followed by an acknowledge bit. the ack flag is controlled by the sio1 hardware and cannot be accessed by the cpu. serial data is shifted through the ack flag into s1dat on the rising edges of serial clock pulses on the scl line. when a byte has been shifted into s1dat, the serial data is available in s1dat, and the acknowledge bit is returned by the control logic during the ninth clock pulse. serial data is shifted out from s1dat via a buffer (bsd7) on the falling edges of clock pulses on the scl line. when the cpu writes to s1dat, bsd7 is loaded with the content of s1dat.7, which is the first bit to be transmitted to the sda line (see figure 39). after nine serial clock pulses, the eight bits in s1dat will have been transmitted to the sda line, and the acknowledge bit will be present in ack. note that the eight transmitted bits are shifted back into s1dat. the control register, s1con: the cpu can read from and write to this 8-bit, directly addressable sfr. two bits are affected by the sio1 hardware: the si bit is set when a serial interrupt is requested, and the sto bit is cleared when a stop condition is present on the i 2 c bus. the sto bit is also cleared when ens1 = a0o. s1con (d8h) ens1 sta sto si aa cr1 cr0 7 6543210 cr2 ens 1, the sio 1 e nable b it ens1 = a0o: when ens1 is a0o, the sda and scl outputs are in a high impedance state. sda and scl input signals are ignored, sio1 is in the anot addressedo slave state, and the sto bit in s1con is forced to a0o. no other bits are affected. p1.6 and p1.7 may be used as open drain i/o ports. ens1 = a1o: when ens1 is a1o, sio1 is enabled. the p1.6 and p1.7 port latches must be set to logic 1. ens1 should not be used to temporarily release sio1 from the i2c bus since, when ens1 is reset, the i2c bus status is lost. the aa flag should be used instead (see description of the aa flag in the following text).
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 36 internal bus 8 bsd7 s1dat ack scl sda shift pulses su00969 figure 38. serial input/output configuration shift in sda scl d7 d6 d5 d4 d3 d2 d1 d0 a shift ack & s1dat ack (2) (2) (2) (2) (2) (2) (2) (2) a (2) (2) (2) (2) (2) (2) (2) (2) (1) (1) s1dat shift bsd7 bsd7 d7 d6 d5 d4 d3 d2 d1 d0 (3) loaded by the cpu (1) valid data in s1dat (2) shifting data in s1dat and ack (3) high level on sda shift out su00970 figure 39. shift-in and shift-out timing in the following text, it is assumed that ens1 = a1o. sta , the start f lag sta = a1o: when the sta bit is set to enter a master mode, the sio1 hardware checks the status of the i2c bus and generates a start condition if the bus is free. if the bus is not free, then sio1 waits for a stop condition (which will free the bus) and generates a start condition after a delay of a half clock period of the internal serial clock generator. if sta is set while sio1 is already in a master mode and one or more bytes are transmitted or received, sio1 transmits a repeated start condition. sta may be set at any time. sta may also be set when sio1 is an addressed slave. sta = a0o: when the sta bit is reset, no start condition or repeated start condition will be generated. sto , the stop f lag sto = a1o: when the sto bit is set while sio1 is in a master mode, a stop condition is transmitted to the i 2 c bus. when the stop condition is detected on the bus, the sio1 hardware clears the sto flag. in a slave mode, the sto flag may be set to recover from an error condition. in this case, no stop condition is transmitted to the i 2 c bus. however, the sio1 hardware behaves as if a stop condition has been received and switches to the defined anot addressedo slave receiver mode. the sto flag is automatically cleared by hardware.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 37 if the sta and sto bits are both set, the a stop condition is transmitted to the i 2 c bus if sio1 is in a master mode (in a slave mode, sio1 generates an internal stop condition which is not transmitted). sio1 then transmits a start condition. sto = a0o: when the sto bit is reset, no stop condition will be generated. si , the s erial i nterrupt f lag si = a1o: when the si flag is set, then, if the ea and es1 (interrupt enable register) bits are also set, a serial interrupt is requested. si is set by hardware when one of 25 of the 26 possible sio1 states is entered. the only state that does not cause si to be set is state f8h, which indicates that no relevant state information is available. while si is set, the low period of the serial clock on the scl line is stretched, and the serial transfer is suspended. a high level on the scl line is unaffected by the serial interrupt flag. si must be reset by software. si = a0o: when the si flag is reset, no serial interrupt is requested, and there is no stretching of the serial clock on the scl line. aa , the a ssert a cknowledge f lag aa = a1o: if the aa flag is set, an acknowledge (low level to sda) will be returned during the acknowledge clock pulse on the scl line when: the aown slave addresso has been received the general call address has been received while the general call bit (gc) in s1adr is set a data byte has been received while sio1 is in the master receiver mode a data byte has been received while sio1 is in the addressed slave receiver mode aa = a0o: if the aa flag is reset, a not acknowledge (high level to sda) will be returned during the acknowledge clock pulse on scl when: a data has been received while sio1 is in the master receiver mode a data byte has been received while sio1 is in the addressed slave receiver mode when sio1 is in the addressed slave transmitter mode, state c8h will be entered after the last serial is transmitted (see figure 43). when si is cleared, sio1 leaves state c8h, enters the not addressed slave receiver mode, and the sda line remains at a high level. in state c8h, the aa flag can be set again for future address recognition. when sio1 is in the not addressed slave mode, its own slave address and the general call address are ignored. consequently, no acknowledge is returned, and a serial interrupt is not requested. thus, sio1 can be temporarily released from the i 2 c bus while the bus status is monitored. while sio1 is released from the bus, start and stop conditions are detected, and serial data is shifted in. address recognition can be resumed at any time by setting the aa flag. if the aa flag is set when the part's own slave address or the general call address has been partly received, the address will be recognized at the end of the byte transmission. cr 0, cr 1, and cr 2, the c lock r ate b its these three bits determine the serial clock frequency when sio1 is in a master mode. the various serial rates are shown in table 5. a 12.5khz bit rate may be used by devices that interface to the i 2 c bus via standard i/o port lines which are software driven and slow. 100khz is usually the maximum bit rate and can be derived from a 16 mhz, 12 mhz, or a 6 mhz oscillator. a variable bit rate (0.5khz to 62.5khz) may also be used if timer 1 is not required for any other purpose while sio1 is in a master mode. the frequencies shown in table 5 are unimportant when sio1 is in a slave mode. in the slave modes, sio1 will automatically synchronize with any clock frequency up to 100khz. the status register, s1sta: s1sta is an 8-bit read-only special function register. the three least significant bits are always zero. the five most significant bits contain the status code. there are 26 possible status codes. when s1sta contains f8h, no relevant state information is available and no serial interrupt is requested. all other s1sta values correspond to defined sio1 states. when each of these states is entered, a serial interrupt is requested (si = a1o). a valid status code is present in s1sta one machine cycle after si is set by hardware and is still present one machine cycle after si has been reset by software. table 5. serial clock rates bit frequency (khz) at f osc cr2 cr1 cr0 6 mhz 12 mhz 16 mhz 24 mhz 2 30 mhz 2 f osc divided by 0 0 0 23 47 62.5 94 117 1 256 0 0 1 27 54 71 107 1 134 1 224 0 1 0 31 63 83.3 125 1 156 1 192 0 1 1 37 75 100 150 1 188 1 160 1 0 0 6.25 12.5 17 25 31 960 1 0 1 50 100 133 1 200 1 250 1 120 1 1 0 100 200 267 1 400 1 500 1 60 1 1 1 0.24 < 62.5 0 < 255 0.49 < 62.5 0 < 254 0.65 < 55.6 0 < 253 0.98 < 50.0 0 < 251 1.22 < 52.1 0 < 250 96 (256 (reload value timer 1)) reload value timer 1 in mode 2. notes: 1. these frequencies exceed the upper limit of 100khz of the i 2 c-bus specification and cannot be used in an i 2 c-bus application. 2. at f osc = 24 mhz/30 mhz the maximum i 2 c bus rate of 100khz cannot be realized due to the fixed divider rates.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 38 more information on sio1 operating modes: the four operating modes are: master transmitter master receiver slave receiver slave transmitter data transfers in each mode of operation are shown in figures 4043. these figures contain the following abbreviations: abbreviation explanation s start condition sla 7-bit slave address r read bit (high level at sda) w write bit (low level at sda) a acknowledge bit (low level at sda) a not acknowledge bit (high level at sda) data 8-bit data byte p stop condition in figures 40-43, circles are used to indicate when the serial interrupt flag is set. the numbers in the circles show the status code held in the s1sta register. at these points, a service routine must be executed to continue or complete the serial transfer. these service routines are not critical since the serial transfer is suspended until the serial interrupt flag is cleared by software. when a serial interrupt routine is entered, the status code in s1sta is used to branch to the appropriate service routine. for each status code, the required software action and details of the following serial transfer are given in tables 6-10. master transmitter mode: in the master transmitter mode, a number of data bytes are transmitted to a slave receiver (see figure 40). before the master transmitter mode can be entered, s1con must be initialized as follows: s1con (d8h) cr2 ens1 sta sto si aa cr1 cr0 7 6543210 1000x bit rate bit rate cr0, cr1, and cr2 define the serial bit rate. ens1 must be set to logic 1 to enable sio1. if the aa bit is reset, sio1 will not acknowledge its own slave address or the general call address in the event of another device becoming master of the bus. in other words, if aa is reset, sio0 cannot enter a slave mode. sta, sto, and si must be reset. the master transmitter mode may now be entered by setting the sta bit using the setb instruction. the sio1 logic will now test the i 2 c bus and generate a start condition as soon as the bus becomes free. when a start condition is transmitted, the serial interrupt flag (si) is set, and the status code in the status register (s1sta) will be 08h. this status code must be used to vector to an interrupt service routine that loads s1dat with the slave address and the data direction bit (sla+w). the si bit in s1con must then be reset before the serial transfer can continue. when the slave address and the direction bit have been transmitted and an acknowledgment bit has been received, the serial interrupt flag (si) is set again, and a number of status codes in s1sta are possible. there are 18h, 20h, or 38h for the master mode and also 68h, 78h, or b0h if the slave mode was enabled (aa = logic 1). the appropriate action to be taken for each of these status codes is detailed in table 6. after a repeated start condition (state 10h). sio1 may switch to the master receiver mode by loading s1dat with sla+r). master receiver mode: in the master receiver mode, a number of data bytes are received from a slave transmitter (see figure 41). the transfer is initialized as in the master transmitter mode. when the start condition has been transmitted, the interrupt service routine must load s1dat with the 7-bit slave address and the data direction bit (sla+r). the si bit in s1con must then be cleared before the serial transfer can continue. when the slave address and the data direction bit have been transmitted and an acknowledgment bit has been received, the serial interrupt flag (si) is set again, and a number of status codes in s1sta are possible. these are 40h, 48h, or 38h for the master mode and also 68h, 78h, or b0h if the slave mode was enabled (aa = logic 1). the appropriate action to be taken for each of these status codes is detailed in table 7. ens1, cr1, and cr0 are not affected by the serial transfer and are not referred to in table 7. after a repeated start condition (state 10h), sio1 may switch to the master transmitter mode by loading s1dat with sla+w. slave receiver mode: in the slave receiver mode, a number of data bytes are received from a master transmitter (see figure 42). to initiate the slave receiver mode, s1adr and s1con must be loaded as follows: s1adr (dbh) xgc 7 65 432 1 0 own slave address x xx xx x the upper 7 bits are the address to which sio1 will respond when addressed by a master. if the lsb (gc) is set, sio1 will respond to the general call address (00h); otherwise it ignores the general call address. s1con (d8h) ens1 sta sto si aa cr1 cr0 7 6543210 x1 0001x x cr2 cr0, cr1, and cr2 do not affect sio1 in the slave mode. ens1 must be set to logic 1 to enable sio1. the aa bit must be set to enable sio1 to acknowledge its own slave address or the general call address. sta, sto, and si must be reset. when s1adr and s1con have been initialized, sio1 waits until it is addressed by its own slave address followed by the data direction bit which must be a0o (w) for sio1 to operate in the slave receiver mode. after its own slave address and the w bit have been received, the serial interrupt flag (i) is set and a valid status code can be read from s1sta. this status code is used to vector to an interrupt service routine, and the appropriate action to be taken for each of these status codes is detailed in table 8. the slave receiver mode may also be entered if arbitration is lost while sio1 is in the master mode (see status 68h and 78h). if the aa bit is reset during a transfer, sio1 will return a not acknowledge (logic 1) to sda after the next received data byte. while aa is reset, sio1 does not respond to its own slave address or a general call address. however, the i 2 c bus is still monitored and address recognition may be resumed at any time by setting aa. this means that the aa bit may be used to temporarily isolate sio1 from the i 2 c bus.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 39 ???????? ???????? ??? ??? ??? ??? ??? ??? s sla wa a data p ??????? ??????? ??????? s sla w ??? ??? a p ??? ??? ??? a p 08h 18h 28h ??? ??? r 38h a or a other mst continues a or a other mst continues 38h 30h 20h 68h 78h 80h other mst continues a mt 10h to mst/rec mode entry = mr to corresponding states in slave mode successful transmission to a slave receiver next transfer started with a repeated start condition not acknowledge received after the slave address not acknowledge received after a data byte arbitration lost in slave address or data byte arbitration lost and addressed as slave ???? ???? ???? ???? ??? ??? ??? ?? ?? ?? a n from master to slave from slave to master any number of data bytes and their associated acknowledge bits this number (contained in s1sta) corresponds to a defined state of the i 2 c bus. see table 6. data su00971 figure 40. format and states in the master transmitter mode
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 40 ???????? ???????? ??? ??? s sla ra data p ??????? ??????? ??????? s sla r ??? ??? a p 08h 40h 50h ??? ??? w 38h a or a other mst continues other mst continues 38h 48h 68h 78h 80h other mst continues a mr 10h to mst/trx mode entry = mt to corresponding states in slave mode successful reception from a slave transmitter next transfer started with a repeated start condition not acknowledge received after the slave address arbitration lost in slave address or acknowledge bit arbitration lost and addressed as slave ???? ???? ???? ???? ???? n from master to slave from slave to master any number of data bytes and their associated acknowledge bits this number (contained in s1sta) corresponds to a defined state of the i 2 c bus. see table 7. ??? ??? a ???? ???? data ??? ??? a 58h ??? ??? ??? a ?? ?? data a su00972 figure 41. format and states in the master receiver mode
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 41 ??????? ??????? ??? ??? ???? ???? ??? ??? s sla wa a data p or s a 60h 80h 68h reception of the own slave address and one or more data bytes all are acknowledged. last data byte received is not acknowledged arbitration lost as mst and addressed as slave reception of the general call address and one or more data bytes last data byte is not acknowledged arbitration lost as mst and addressed as slave by general call ???? ???? ???? ???? ??? ??? ??? ?? ?? ?? a n from master to slave from slave to master any number of data bytes and their associated acknowledge bits this number (contained in s1sta) corresponds to a defined state of the i 2 c bus. see table 8. data a sla ??? ??? data 80h a0h ??? ??? ??? a 88h p or s ????? ????? ????? ??? ??? ??? ???? ???? ???? ??? ??? ??? ??? ??? ??? ??? ??? ??? general call aa data p or s 70h 90h 78h a data 90h a0h a 98h p or s a su00973 figure 42. format and states in the slave receiver mode
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 42 ???????? ???????? ???????? ??? ??? ??? ??? ??? ??? ???? ???? ???? ??? ??? ??? s sla ra data p or s b0h a8h b8h reception of the own slave address and transmission of one or more data bytes a data a c0h ???? ???? ?? ?? n any number of data bytes and their associated acknowledge bits this number (contained in s1sta) corresponds to a defined state of the i 2 c bus. see table 9. data a ??? ??? ??? all a1os ??? ??? ??? a a ???? ???? from master to slave from slave to master c8h p or s last data byte transmitted. switched to not addressed slave (aa bit in s1con = a0o arbitration lost as mst and addressed as slave su00974 figure 43. format and states of the slave transmitter mode
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 43 table 6. master transmitter mode status status of the application software response status code (s1sta) status of the i 2 c bus and sio1 hardware to/from s1dat to s1con next action taken by sio1 hardware (s1sta) sio1 hardware to/from s1dat sta sto si aa 08h a start condition has been transmitted load sla+w x 0 0 x sla+w will be transmitted; ack bit will be received 10h a repeated start diti h b load sla+w or x 0 0 x as above condition has been transmitted load sla+r x 0 0 x sla+w will be transmitted; sio1 will be switched to mst/rec mode 18h sla+w has been transmitted; ack has bid load data byte or 0 0 0 x data byte will be transmitted; ack bit will be received been received no s1dat action or 1 0 0 x repeated start will be transmitted; no s1dat action or 0 1 0 x stop condition will be transmitted; sto flag will be reset no s1dat action 1 1 0 x stop condition followed by a start condition will be transmitted; sto flag will be reset 20h sla+w has been transmitted; not ack hb id load data byte or 0 0 0 x data byte will be transmitted; ack bit will be received has been received no s1dat action or 1 0 0 x repeated start will be transmitted; no s1dat action or 0 1 0 x stop condition will be transmitted; sto flag will be reset no s1dat action 1 1 0 x stop condition followed by a start condition will be transmitted; sto flag will be reset 28h data byte in s1dat has been transmitted; ack hb id load data byte or 0 0 0 x data byte will be transmitted; ack bit will be received has been received no s1dat action or 1 0 0 x repeated start will be transmitted; no s1dat action or 0 1 0 x stop condition will be transmitted; sto flag will be reset no s1dat action 1 1 0 x stop condition followed by a start condition will be transmitted; sto flag will be reset 30h data byte in s1dat has been transmitted; not ack h b i d load data byte or 0 0 0 x data byte will be transmitted; ack bit will be received ack has been received no s1dat action or 1 0 0 x repeated start will be transmitted; no s1dat action or 0 1 0 x stop condition will be transmitted; sto flag will be reset no s1dat action 1 1 0 x stop condition followed by a start condition will be transmitted; sto flag will be reset 38h arbitration lost in sla+r/w or db no s1dat action or 0 0 0 x i 2 c bus will be released; not addressed slave will be entered data bytes no s1dat action 1 0 0 x a start condition will be transmitted when the bus becomes free
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 44 table 7. master receiver mode status status of the i 2 c application software response status code (s1sta) status of the i 2 c bus and sio1 hardware to/from s1dat to s1con next action taken by sio1 hardware (s1sta) sio1 hardware to/from s1dat sta sto si aa 08h a start condition has been transmitted load sla+r x 0 0 x sla+r will be transmitted; ack bit will be received 10h a repeated start diti h b load sla+r or x 0 0 x as above condition has been transmitted load sla+w x 0 0 x sla+w will be transmitted; sio1 will be switched to mst/trx mode 38h arbitration lost in not ack bit no s1dat action or 0 0 0 x i 2 c bus will be released; sio1 will enter a slave mode no s1dat action 1 0 0 x a start condition will be transmitted when the bus becomes free 40h sla+r has been transmitted; ack has bid no s1dat action or 0 0 0 0 data byte will be received; not ack bit will be returned been received no s1dat action 0 0 0 1 data byte will be received; ack bit will be returned 48h sla+r has been t itt d not ack no s1dat action or 1 0 0 x repeated start condition will be transmitted transmitted; not ack has been received no s1dat action or 0 1 0 x stop condition will be transmitted; sto flag will be reset no s1dat action 1 1 0 x stop condition followed by a start condition will be transmitted; sto flag will be reset 50h data byte has been received; ack has been d read data byte or 0 0 0 0 data byte will be received; not ack bit will be returned returned read data byte 0 0 0 1 data byte will be received; ack bit will be returned 58h data byte has been i d not ack h read data byte or 1 0 0 x repeated start condition will be transmitted received; not ack has been returned read data byte or 0 1 0 x stop condition will be transmitted; sto flag will be reset read data byte 1 1 0 x stop condition followed by a start condition will be transmitted; sto flag will be reset
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 45 table 8. slave receiver mode status status of the application software response status code (s1sta) status of the i 2 c bus and sio1 hardware to/from s1dat to s1con next action taken by sio1 hardware (s1sta) sio1 hardware to/from s1dat sta sto si aa 60h own sla+w has been received; ack hb d no s1dat action or x 0 0 0 data byte will be received and not ack will be returned has been returned no s1dat action x 0 0 1 data byte will be received and ack will be returned 68h arbitration lost in sla+r/w as master; own sla+w has b i d ack no s1dat action or x 0 0 0 data byte will be received and not ack will be returned been received, ack returned no s1dat action x 0 0 1 data byte will be received and ack will be returned 70h general call address (00h) has been received ; ack has no s1dat action or x 0 0 0 data byte will be received and not ack will be returned received ack has been returned no s1dat action x 0 0 1 data byte will be received and ack will be returned 78h arbitration lost in sla+r/w as master; general call address has been received no s1dat action or x 0 0 0 data byte will be received and not ack will be returned has been received , ack has been returned no s1dat action x 0 0 1 data byte will be received and ack will be returned 80h previously addressed with own slv address; data has b i d ack read data byte or x 0 0 0 data byte will be received and not ack will be returned been received; ack has been returned read data byte x 0 0 1 data byte will be received and ack will be returned 88h previously addressed with own sla; data bhb read data byte or 0 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address byte has been received; not ack has been returned read data byte or 0 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if s1adr.0 = logic 1 read data byte or 1 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. a start condition will be transmitted when the bus becomes free read data byte 1 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if s1adr.0 = logic 1. a start condition will be transmitted when the bus becomes free. 90h previously addressed with general call; data byte has been i d ack h read data byte or x 0 0 0 data byte will be received and not ack will be returned received; ack has been returned read data byte x 0 0 1 data byte will be received and ack will be returned 98h previously addressed with general call; data b h b read data byte or 0 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address data byte has been received; not ack has been returned read data byte or 0 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if s1adr.0 = logic 1 read data byte or 1 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. a start condition will be transmitted when the bus becomes free read data byte 1 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if s1adr.0 = logic 1. a start condition will be transmitted when the bus becomes free.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 46 table 8. slave receiver mode (continued) status status of the application software response status code (s1sta) status of the i 2 c bus and sio1 hardware to/from s1dat to s1con next action taken by sio1 hardware (s1sta) sio1 hardware to/from s1dat sta sto si aa a0h a stop condition or repeated start di i h b no stdat action or 0 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address condition has been received while still addressed as slv/rec or slv/trx no stdat action or 0 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if s1adr.0 = logic 1 slv/rec or slv/trx no stdat action or 1 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. a start condition will be transmitted when the bus becomes free no stdat action 1 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if s1adr.0 = logic 1. a start condition will be transmitted when the bus becomes free. table 9. slave transmitter mode status status of the application software response status code (s1sta) status of the i 2 c bus and sio1 hardware to/from s1dat to s1con next action taken by sio1 hardware (s1sta) sio1 hardware to/from s1dat sta sto si aa a8h own sla+r has been received; ack hb d load data byte or x 0 0 0 last data byte will be transmitted and ack bit will be received has been returned load data byte x 0 0 1 data byte will be transmitted; ack will be received b0h arbitration lost in sla+r/w as master; own sla+r has load data byte or x 0 0 0 last data byte will be transmitted and ack bit will be received been received, ack has been returned load data byte x 0 0 1 data byte will be transmitted; ack bit will be received b8h data byte in s1dat has been transmitted; ack has been load data byte or x 0 0 0 last data byte will be transmitted and ack bit will be received ack has been received load data byte x 0 0 1 data byte will be transmitted; ack bit will be received c0h data byte in s1dat has been transmitted; not ack h b no s1dat action or 0 0 0 01 switched to not addressed slv mode; no recognition of own sla or general call address not ack has been received no s1dat action or 0 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if s1adr.0 = logic 1 no s1dat action or 1 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. a start condition will be transmitted when the bus becomes free no s1dat action 1 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if s1adr.0 = logic 1. a start condition will be transmitted when the bus becomes free. c8h last data byte in s1dat has been i d (aa 0) no s1dat action or 0 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address transmitted (aa = 0); ack has been received no s1dat action or 0 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if s1adr.0 = logic 1 no s1dat action or 1 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. a start condition will be transmitted when the bus becomes free no s1dat action 1 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if s1adr.0 = logic 1. a start condition will be transmitted when the bus becomes free.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 47 table 10. miscellaneous states status status of the application software response status code (s1sta) status of the i 2 c bus and sio1 hardware to/from s1dat to s1con next action taken by sio1 hardware (s1sta) sio1 hardware to/from s1dat sta sto si aa f8h no relevant state information available; si = 0 no s1dat action no s1con action wait or proceed current transfer 00h bus error during mst or selected slave modes, due to an illegal start or stop condition. state 00h can also occur when interference causes sio1 to enter an undefined state. no s1dat action 0 1 0 x only the internal hardware is affected in the mst or addressed slv modes. in all cases, the bus is released and sio1 is switched to the not addressed slv mode. sto is reset. slave transmitter mode: in the slave transmitter mode, a number of data bytes are transmitted to a master receiver (see figure 43). data transfer is initialized as in the slave receiver mode. when s1adr and s1con have been initialized, sio1 waits until it is addressed by its own slave address followed by the data direction bit which must be a1o (r) for sio1 to operate in the slave transmitter mode. after its own slave address and the r bit have been received, the serial interrupt flag (si) is set and a valid status code can be read from s1sta. this status code is used to vector to an interrupt service routine, and the appropriate action to be taken for each of these status codes is detailed in table 9. the slave transmitter mode may also be entered if arbitration is lost while sio1 is in the master mode (see state b0h). if the aa bit is reset during a transfer, sio1 will transmit the last byte of the transfer and enter state c0h or c8h. sio1 is switched to the not addressed slave mode and will ignore the master receiver if it continues the transfer. thus the master receiver receives all 1s as serial data. while aa is reset, sio1 does not respond to its own slave address or a general call address. however, the i 2 c bus is still monitored, and address recognition may be resumed at any time by setting aa. this means that the aa bit may be used to temporarily isolate sio1 from the i 2 c bus. miscellaneous states: there are two s1sta codes that do not correspond to a defined sio1 hardware state (see table 10). these are discussed below. s1sta = f8h: this status code indicates that no relevant information is available because the serial interrupt flag, si, is not yet set. this occurs between other states and when sio1 is not involved in a serial transfer. s1sta = 00h: this status code indicates that a bus error has occurred during an sio1 serial transfer. a bus error is caused when a start or stop condition occurs at an illegal position in the format frame. examples of such illegal positions are during the serial transfer of an address byte, a data byte, or an acknowledge bit. a bus error may also be caused when external interference disturbs the internal sio1 signals. when a bus error occurs, si is set. to recover from a bus error, the sto flag must be set and si must be cleared. this causes sio1 to enter the anot addressedo slave mode (a defined state) and to clear the sto flag (no other bits in s1con are affected). the sda and scl lines are released (a stop condition is not transmitted). some special cases: the sio1 hardware has facilities to handle the following special cases that may occur during a serial transfer: simultaneous repeated start conditions from two masters a repeated start condition may be generated in the master transmitter or master receiver modes. a special case occurs if another master simultaneously generates a repeated start condition (see figure 44). until this occurs, arbitration is not lost by either master since they were both transmitting the same data. if the sio1 hardware detects a repeated start condition on the i 2 c bus before generating a repeated start condition itself, it will release the bus, and no interrupt request is generated. if another master frees the bus by generating a stop condition, sio1 will transmit a normal start condition (state 08h), and a retry of the total serial data transfer can commence. d ata t ransfer a fter l oss of a rbitration arbitration may be lost in the master transmitter and master receiver modes (see figure 36). loss of arbitration is indicated by the following states in s1sta; 38h, 68h, 78h, and b0h (see figures 40 and 41). if the sta flag in s1con is set by the routines which service these states, then, if the bus is free again, a start condition (state 08h) is transmitted without intervention by the cpu, and a retry of the total serial transfer can commence. f orced a ccess to the i 2 c b us in some applications, it may be possible for an uncontrolled source to cause a bus hang-up. in such situations, the problem may be caused by interference, temporary interruption of the bus or a temporary short-circuit between sda and scl. if an uncontrolled source generates a superfluous start or masks a stop condition, then the i 2 c bus stays busy indefinitely. if the sta flag is set and bus access is not obtained within a reasonable amount of time, then a forced access to the i 2 c bus is possible. this is achieved by setting the sto flag while the sta flag is still set. no stop condition is transmitted. the sio1 hardware behaves as if a stop condition was received and is able to transmit a start condition. the sto flag is cleared by hardware (see figure 45).
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 48 s 08h sla w a data a s other mst continues p s sla 18h 28h 08h other master sends repeated start condition earlier retry su00975 figure 44. simultaneous repeated start conditions from 2 masters sta flag sto flag time limit sda line scl line start condition su00976 figure 45. forced access to a busy i 2 c bus i 2 c b us o bstructed by a l ow l evel on scl or sda an i 2 c bus hang-up occurs if sda or scl is pulled low by an uncontrolled source. if the scl line is obstructed (pulled low) by a device on the bus, no further serial transfer is possible, and the sio1 hardware cannot resolve this type of problem. when this occurs, the problem must be resolved by the device that is pulling the scl bus line low. if the sda line is obstructed by another device on the bus (e.g., a slave device out of bit synchronization), the problem can be solved by transmitting additional clock pulses on the scl line (see figure 46). the sio1 hardware transmits additional clock pulses when the sta flag is set, but no start condition can be generated because the sda line is pulled low while the i 2 c bus is considered free. the sio1 hardware attempts to generate a start condition after every two additional clock pulses on the scl line. when the sda line is eventually released, a normal start condition is transmitted, state 08h is entered, and the serial transfer continues. if a forced bus access occurs or a repeated start condition is transmitted while sda is obstructed (pulled low), the sio1 hardware performs the same action as described above. in each case, state 08h is entered after a successful start condition is transmitted and normal serial transfer continues. note that the cpu is not involved in solving these bus hang-up problems. b us e rror a bus error occurs when a start or stop condition is present at an illegal position in the format frame. examples of illegal positions are during the serial transfer of an address byte, a data or an acknowledge bit. the sio1 hardware only reacts to a bus error when it is involved in a serial transfer either as a master or an addressed slave. when a bus error is detected, sio1 immediately switches to the not addressed slave mode, releases the sda and scl lines, sets the interrupt flag, and loads the status register with 00h. this status code may be used to vector to a service routine which either attempts the aborted serial transfer again or simply recovers from the error condition as shown in table 10.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 49 sta flag start condition (1) unsuccessful attempt to send a start condition (2) sda line released (3) successful attempt to send a start condition; state 08h is entered sda line scl line (1) (1) (2) (3) su00977 figure 46. recovering from a bus obstruction caused by a low level on sda software examples of sio1 service routines: this section consists of a software example for: initialization of sio1 after a reset entering the sio1 interrupt routine the 26 state service routines for the master transmitter mode master receiver mode slave receiver mode slave transmitter mode i nitialization in the initialization routine, sio1 is enabled for both master and slave modes. for each mode, a number of bytes of internal data ram are allocated to the sio to act as either a transmission or reception buffer. in this example, 8 bytes of internal data ram are reserved for different purposes. the data memory map is shown in figure 47. the initialization routine performs the following functions: s1adr is loaded with the part's own slave address and the general call bit (gc) p1.6 and p1.7 bit latches are loaded with logic 1s ram location hadd is loaded with the high-order address byte of the service routines the sio1 interrupt enable and interrupt priority bits are set the slave mode is enabled by simultaneously setting the ens1 and aa bits in s1con and the serial clock frequency (for master modes) is defined by loading cr0 and cr1 in s1con. the master routines must be started in the main program. the sio1 hardware now begins checking the i 2 c bus for its own slave address and general call. if the general call or the own slave address is detected, an interrupt is requested and s1sta is loaded with the appropriate state information. the following text describes a fast method of branching to the appropriate service routine. sio 1 i nterrupt r outine when the sio1 interrupt is entered, the psw is first pushed on the stack. then s1sta and hadd (loaded with the high-order address byte of the 26 service routines by the initialization routine) are pushed on to the stack. s1sta contains a status code which is the lower byte of one of the 26 service routines. the next instruction is ret, which is the return from subroutine instruction. when this instruction is executed, the high and low order address bytes are popped from stack and loaded into the program counter. the next instruction to be executed is the first instruction of the state service routine. seven bytes of program code (which execute in eight machine cycles) are required to branch to one of the 26 state service routines. si push psw save psw push s1sta push status code (low order address byte) push hadd push high order address byte ret jump to state service routine the state service routines are located in a 256-byte page of program memory. the location of this page is defined in the initialization routine. the page can be located anywhere in program memory by loading data ram register hadd with the page number. page 01 is chosen in this example, and the service routines are located between addresses 0100h and 01ffh. t he s tate s ervice r outines the state service routines are located 8 bytes from each other. eight bytes of code are sufficient for most of the service routines. a few of the routines require more than 8 bytes and have to jump to other locations to obtain more bytes of code. each state routine is part of the sio1 interrupt routine and handles one of the 26 states. it ends with a reti instruction which causes a return to the main program.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 50 db s1adr gc s1dat 0 0 cr0 cr! si 0 aa st0 sta cr2 ens1 special function registers 53 backup numbytmst internal data ram s1sta s1con psw da d9 d8 d0 ps1 ipo b8 ien0 ab es1 ea p1.7 p1.6 p1 90 80 7f original value of numbytmst number of bytes as master 52 sla sla+r/w to be transmitted to sla 51 hadd higher address byte interrupt routine 50 slave transmitter data ram 4f std 48 slave receiver data ram srd 40 master receiver data ram mrd 38 master transmitter data ram mtd 30 19 r1 r0 18 00 su00978 figure 47. sio1 data memory map
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 51 m aster t ransmitter and m aster r eceiver m odes the master mode is entered in the main program. to enter the master transmitter mode, the main program must first load the internal data ram with the slave address, data bytes, and the number of data bytes to be transmitted. to enter the master receiver mode, the main program must first load the internal data ram with the slave address and the number of data bytes to be received. the r/w bit determines whether sio1 operates in the master transmitter or master receiver mode. master mode operation commences when the sta bit in s1cion is set by the setb instruction and data transfer is controlled by the master state service routines in accordance with table 6, table 7, figure 40, and figure 41. in the example below, 4 bytes are transferred. there is no repeated start condition. in the event of lost arbitration, the transfer is restarted when the bus becomes free. if a bus error occurs, the i 2 c bus is released and sio1 enters the not selected slave receiver mode. if a slave device returns a not acknowledge, a stop condition is generated. a repeated start condition can be included in the serial transfer if the sta flag is set instead of the sto flag in the state service routines vectored to by status codes 28h and 58h. additional software must be written to determine which data is transferred after a repeated start condition. s lave t ransmitter and s lave r eceiver m odes after initialization, sio1 continually tests the i 2 c bus and branches to one of the slave state service routines if it detects its own slave address or the general call address (see table 8, table 9, figure 42, and figure 43). if arbitration was lost while in the master mode, the master mode is restarted after the current transfer. if a bus error occurs, the i 2 c bus is released and sio1 enters the not selected slave receiver mode. in the slave receiver mode, a maximum of 8 received data bytes can be stored in the internal data ram. a maximum of 8 bytes ensures that other ram locations are not overwritten if a master sends more bytes. if more than 8 bytes are transmitted, a not acknowledge is returned, and sio1 enters the not addressed slave receiver mode. a maximum of one received data byte can be stored in the internal data ram after a general call address is detected. if more than one byte is transmitted, a not acknowledge is returned and sio1 enters the not addressed slave receiver mode. in the slave transmitter mode, data to be transmitted is obtained from the same locations in the internal data ram that were previously loaded by the main program. after a not acknowledge has been returned by a master receiver device, sio1 enters the not addressed slave mode. a dapting the s oftware for d ifferent a pplications the following software example shows the typical structure of the interrupt routine including the 26 state service routines and may be used as a base for user applications. if one or more of the four modes are not used, the associated state service routines may be removed but, care should be taken that a deleted routine can never be invoked. this example does not include any time-out routines. in the slave modes, time-out routines are not very useful since, in these modes, sio1 behaves essentially as a passive device. in the master modes, an internal timer may be used to cause a time-out if a serial transfer is not complete after a defined period of time. this time period is defined by the system connected to the i 2 c bus.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 52 !******************************************************************************************************** ! si01 equate list !******************************************************************************************************** !******************************************************************************************************** ! locations of the si01 special function registers !******************************************************************************************************** 00d8 s1con 0xd8 00d9 s1sta 0xd9 00da s1dat 0xda 00db s1adr 0xdb 00a8 ien0 0xa8 00b8 ip0 02b8 !******************************************************************************************************** ! bit locations !******************************************************************************************************** 00dd sta 0xdd ! sta bit in s1con 00bd si01hp 0xbd ! ip0, si01 priority bit !******************************************************************************************************** ! immediate data to write into register s1con !******************************************************************************************************** 00d5 ens1_notsta_sto_notsi_aa_cr0 0xd5 ! generates stop ! (cr0 = 100khz) 00c5 ens1_notsta_notsto_notsi_aa_cr0 0xc5 ! releases bus and ! ack 00c1 ens1_notsta_notsto_notsi_notaa_cr0 0xc1 ! releases bus and ! not ack 00e5 ens1_sta_notsto_notsi_aa_cr0 0xe5 ! releases bus and ! set sta !******************************************************************************************************** ! general immediate data !******************************************************************************************************** 0031 ownsla 0x31 ! own sla+general call ! must be written into s1adr 00a0 ensi01 0xa0 ! ea+es1, enable sio1 interrupt ! must be written into ien0 0001 pag1 0x01 ! select pag1 as hadd 00c0 slaw 0xc0 ! sla+w to be transmitted 00c1 slar 0xc1 ! sla+r to be transmitted 0018 selrb3 0x18 ! select register bank 3 !******************************************************************************************************** ! locations in data ram !******************************************************************************************************** 0030 mtd 0x30 ! mst/trx/data base address 0038 mrd 0x38 ! mst/rec/data base address 0040 srd 0x40 ! slv/rec/data base address 0048 std 0x48 ! slv/trx/data base address 0053 backup 0x53 ! backup from numbytmst ! to restore numbytmst in case ! of an arbitration loss. 0052 numbytmst 0x52 ! number of bytes to transmit ! or receive as mst. 0051 sla 0x51 ! contains sla+r/w to be ! transmitted. 0050 hadd 0x50 ! high address byte for state 0 ! till state 25.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 53 !******************************************************************************************************** ! initialization routine ! example to initialize iic interface as slave receiver or slave transmitter and ! start a master transmit or a master receive function. 4 bytes will be transmitted or received. !******************************************************************************************************** .sect strt .base 0x00 0000 4100 ajmp init ! reset .sect initial .base 0x200 0200 75db31 init: mov s1adr,#ownsla ! load own sla + enable ! general call recognition 0203 d296 setb p1(6) ! p1.6 high level. 0205 d297 setb p1(7) ! p1.7 high level. 0207 755001 mov hadd,#pag1 020a 43a8a0 orl ien0,#ensi01 ! enable si01 interrupt 020d c2bd clr si01hp ! si01 interrupt low priority 020f 75d8c5 mov s1con, #ens1_notsta_notsto_notsi_aa_cr0 ! initialize slv funct. !******************************************************************************************************** ! ! start master transmit function ! 0212 755204 mov numbytmst,#0x4 ! transmit 4 bytes. 0215 7551c0 mov sla,#slaw ! sla+w, transmit funct. 0218 d2dd setb sta ! set sta in s1con ! ! start master receive function ! 021a 755204 mov numbytmst,#0x4 ! receive 4 bytes. 021d 7551c1 mov sla,#slar ! sla+r, receive funct. 0220 d2dd setb sta ! set sta in s1con !******************************************************************************************************** ! si01 interrupt routine !******************************************************************************************************** .sect intvec ! si01 interrupt vector .base 0x00 ! s1sta and hadd are pushed onto the stack. ! they serve as return address for the ret instruction. ! the ret instruction sets the program counter to address hadd, ! s1sta and jumps to the right subroutine. 002b c0d0 push psw ! save psw 002d c0d9 push s1sta 002f c050 push hadd 0031 22 ret ! jmp to address hadd,s1sta. ! ! state : 00, bus error. ! action : enter not addressed slv mode and release bus. sto reset. ! .sect st0 .base 0x100 0100 75d8d5 mov s1con,#ens1_notsta_sto_notsi_aa_cr0 ! clr si ! set sto,aa 0103 d0d0 pop psw 0105 32 reti
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 54 !******************************************************************************************************** !******************************************************************************************************** ! master state service routines !******************************************************************************************************** ! state 08 and state 10 are both for mst/trx and mst/rec. ! the r/w bit decides whether the next state is within ! mst/trx mode or within mst/rec mode. !******************************************************************************************************** ! ! state : 08, a, start condition has been transmitted. ! action : sla+r/w are transmitted, ack bit is received. ! .sect mts8 .base 0x108 0108 8551da mov s1dat,sla ! load sla+r/w 010b 75d8c5 mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si 010e 01a0 ajmp initbase1 ! ! state : 10, a repeated start condition has been ! transmitted. ! action : sla+r/w are transmitted, ack bit is received. ! .sect mts10 .base 0x110 0110 8551da mov s1dat,sla ! load sla+r/w 0113 75d8c5 mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si 010e 01a0 ajmp initbase1 .sect ibase1 .base 0xa0 00a0 75d018 initbase1: mov psw,#selrb3 00a3 7930 mov r1,#mtd 00a5 7838 mov r0,#mrd 00a7 855253 mov backup,numbytmst ! save initial value 00aa d0d0 pop psw 00ac 32 reti !******************************************************************************************************** !******************************************************************************************************** ! master transmitter state service routines !******************************************************************************************************** !******************************************************************************************************** ! ! state : 18, previous state was state 8 or state 10, sla+w have been transmitted, ! ack has been received. ! action : first data is transmitted, ack bit is received. ! .sect mts18 .base 0x118 0118 75d018 mov psw,#selrb3 011b 87da mov s1dat,@r1 011d 01b5 ajmp con
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 55 ! ! state : 20, sla+w have been transmitted, not ack has been received ! action : transmit stop condition. ! .sect mts20 .base 0x120 0120 75d8d5 mov s1con,#ens1_notsta_sto_notsi_aa_cr0 ! set sto, clr si 0123 d0d0 pop psw 0125 32 reti ! ! state : 28, data of s1dat have been transmitted, ack received. ! action : if transmitted data is last data then transmit a stop condition, ! else transmit next data. ! .sect mts28 .base 0x128 0128 d55285 djnz numbytmst,notldat1 ! jmp if not last data 012b 75d8d5 mov s1con,#ens1_notsta_sto_notsi_aa_cr0 ! clr si, set aa 012e 01b9 ajmp retmt .sect mts28sb .base 0x0b0 00b0 75d018 notldat1: mov psw,#selrb3 00b3 87da mov s1dat,@r1 00b5 75d8c5 con: mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si, set aa 00b8 09 inc r1 00b9 d0d0 retmt : pop psw 00bb 32 reti ! ! state : 30, data of s1dat have been transmitted, not ack received. ! action : transmit a stop condition. ! .sect mts30 .base 0x130 0130 75d8d5 mov s1con,#ens1_notsta_sto_notsi_aa_cr0 ! set sto, clr si 0133 d0d0 pop psw 0135 32 reti ! ! state : 38, arbitration lost in sla+w or data. ! action : bus is released, not addressed slv mode is entered. ! a new start condition is transmitted when the iic bus is free again. ! .sect mts38 .base 0x138 0138 75d8e5 mov s1con,#ens1_sta_notsto_notsi_aa_cr0 013b 855352 mov numbytmst,backup 013e 01b9 ajmp retmt
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 56 !******************************************************************************************************** !******************************************************************************************************** ! master receiver state service routines !******************************************************************************************************** !******************************************************************************************************** ! ! state : 40, previous state was state 08 or state 10, ! sla+r have been transmitted, ack received. ! action : data will be received, ack returned. ! .sect mts40 .base 0x140 0140 75d8c5 mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr sta, sto, si set aa 0143 d0d0 pop psw 32 reti ! ! state : 48, sla+r have been transmitted, not ack received. ! action : stop condition will be generated. ! .sect mts48 .base 0x148 0148 75d8d5 stop: mov s1con,#ens1_notsta_sto_notsi_aa_cr0 ! set sto, clr si 014b d0d0 pop psw 014d 32 reti ! ! state : 50, data have been received, ack returned. ! action : read data of s1dat. ! data will be received, if it is last data then not ack will be returned else ack will be returned. ! .sect mrs50 .base 0x150 0150 75d018 mov psw,#selrb3 0153 a6da mov @r0,s1dat ! read received data 0155 01c0 ajmp rec1 .sect mrs50s .base 0xc0 00c0 d55205 rec1: djnz numbytmst,notldat2 00c3 75d8c1 mov s1con,#ens1_notsta_notsto_notsi_notaa_cr0 ! clr si,aa 00c6 8003 sjmp retmr 00c8 75d8c5 notldat2: mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si, set aa 00cb 08 retmr: inc r0 00cc d0d0 pop psw 00ce 32 reti ! ! state : 58, data have been received, not ack returned. ! action : read data of s1dat and generate a stop condition. ! .sect mrs58 .base 0x158 0158 75d018 mov psw,#selrb3 015b a6da mov @r0,s1dat 015d 80e9 sjmp stop
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 57 !******************************************************************************************************** !******************************************************************************************************** ! slave receiver state service routines !******************************************************************************************************** !******************************************************************************************************** ! ! state : 60, own sla+w have been received, ack returned. ! action : data will be received and ack returned. ! .sect srs60 .base 0x160 0160 75d8c5 mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si, set aa 0163 75d018 mov psw,#selrb3 0166 01d0 ajmp initsrd .sect insrd .base 0xd0 00d0 7840 initsrd: mov r0,#srd 00d2 7908 mov r1,#8 00d4 d0d0 pop psw 00d6 32 reti ! ! state : 68, arbitration lost in sla and r/w as mst ! own sla+w have been received, ack returned ! action : data will be received and ack returned. ! sta is set to restart mst mode after the bus is free again. ! .sect srs68 .base 0x168 0168 75d8e5 mov s1con,#ens1_sta_notsto_notsi_aa_cr0 016b 75d018 mov psw,#selrb3 016e 01d0 ajmp initsrd ! ! state : 70, general call has been received, ack returned. ! action : data will be received and ack returned. ! .sect srs70 .base 0x170 0170 75d8c5 mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si, set aa 0173 75d018 mov psw,#selrb3 ! initialize srd counter 0176 01d0 ajmp initsrd ! ! state : 78, arbitration lost in sla+r/w as mst. ! general call has been received, ack returned. ! action : data will be received and ack returned. ! sta is set to restart mst mode after the bus is free again. ! .sect srs78 .base 0x178 0178 75d8e5 mov s1con,#ens1_sta_notsto_notsi_aa_cr0 017b 75d018 mov psw,#selrb3 ! initialize srd counter 017e 01d0 ajmp initsrd
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 58 ! ! state : 80, previously addressed with own sla. data received, ack returned. ! action : read data. ! if received data was the last ! then superfluous data will be received and not ack returned else next data will be received and ack returned. ! .sect srs80 .base 0x180 0180 75d018 mov psw,#selrb3 0183 a6da mov @r0,s1dat ! read received data 0185 01d8 ajmp rec2 .sect srs80s .base 0xd8 00d8 d906 rec2: djnz r1,notldat3 00da 75d8c1 ldat: mov s1con,#ens1_notsta_notsto_notsi_notaa_cr0 ! clr si,aa 00dd d0d0 pop psw 00df 32 reti 00e0 75d8c5 notldat3: mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si, set aa 00e3 08 inc r0 00e4 d0d0 retsr: pop psw 00e6 32 reti ! ! state : 88, previously addressed with own sla. data received not ack returned. ! action : no save of data, enter not addressed slv mode. ! recognition of own sla. general call recognized, if s1adr. 01. ! .sect srs88 .base 0x188 0188 75d8c5 mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si, set aa 018b 01e4 ajmp retsr ! ! state : 90, previously addressed with general call. ! data has been received, ack has been returned. ! action : read data. after general call only one byte will be received with ack ! the second data will be received with not ack. ! data will be received and not ack returned. ! .sect srs90 .base 0x190 0190 75d018 mov psw,#selrb3 0193 a6da mov @r0,s1dat ! read received data 0195 01da ajmp ldat ! ! state : 98, previously addressed with general call. ! data has been received, not ack has been returned. ! action : no save of data, enter not addressed slv mode. recognition of own sla. general call recognized, if s1adr. 01. ! .sect srs98 .base 0x198 0198 75d8c5 mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si, set aa 019b d0d0 pop psw 019d 32 reti
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 59 ! ! state : a0, a stop condition or repeated start has been received, ! while still addressed as slv/rec or slv/trx. ! action : no save of data, enter not addressed slv mode. ! recognition of own sla. general call recognized, if s1adr. 01. ! .sect srsa0 .base 0x1a0 01a0 75d8c5 mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si, set aa 01a3 d0d0 pop psw 01a5 32 reti !******************************************************************************************************** !******************************************************************************************************** ! slave transmitter state service routines !******************************************************************************************************** !******************************************************************************************************** ! ! state : a8, own sla+r received, ack returned. ! action : data will be transmitted, a bit received. ! .sect stsa8 .base 0x1a8 01a8 8548da mov s1dat,std ! load data in s1dat 01ab 75d8c5 mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si, set aa 01ae 01e8 ajmp initbase2 .sect ibase2 .base 0xe8 00e8 75d018 initbase2: mov psw,#selrb3 00eb 7948 mov r1, #std 00ed 09 inc r1 00ee d0d0 pop psw 00f0 32 reti ! ! state : b0, arbitration lost in sla and r/w as mst. own sla+r received, ack returned. ! action : data will be transmitted, a bit received. ! sta is set to restart mst mode after the bus is free again. ! .sect stsb0 .base 0x1b0 01b0 8548da mov s1dat,std ! load data in s1dat 01b3 75d8e5 mov s1con,#ens1_sta_notsto_notsi_aa_cr0 01b6 01e8 ajmp initbase2
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 60 ! ! state : b8, data has been transmitted, ack received. ! action : data will be transmitted, ack bit is received. ! .sect stsb8 .base 0x1b8 01b8 75d018 mov psw,#selrb3 01bb 87da mov s1dat,@r1 01bd 01f8 ajmp scon .sect scn .base 0xf8 00f8 75d8c5 scon: mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si, set aa 00fb 09 inc r1 00fc d0d0 pop psw 00fe 32 reti ! ! state : c0, data has been transmitted, not ack received. ! action : enter not addressed slv mode. ! .sect stsc0 .base 0x1c0 01c0 75d8c5 mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si, set aa 01c3 d0d0 pop psw 01c5 32 reti ! ! state : c8, last data has been transmitted (aa=0), ack received. ! action : enter not addressed slv mode. ! .sect stsc8 .base 0x1c8 01c8 75d8c5 mov s1con,#ens1_notsta_notsto_notsi_aa_cr0 ! clr si, set aa 01cb d0d0 pop psw 01cd 32 reti !******************************************************************************************************** !******************************************************************************************************** ! end of si01 interrupt routine !******************************************************************************************************** !********************************************************************************************************
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 61 absolute maximum ratings 1, 2, 3 parameter rating unit storage temperature range 65 to +150 c voltage on ea /v pp to v ss 0.5 to +13 v voltage on any other pin to v ss 0.5 to +6.5 v input, output dc current on any single i/o pin 5.0 ma power dissipation (based on package heat transfer limitations, not device power consumption) 1.0 w notes: 1. stresses above those listed under absolute maximum ratings may cause permanent damage to the device. this is a stress rating only and functional operation of the device at these or any conditions other than those described in the ac and dc electrical characteri stics section of this specification is not implied. 2. this product includes circuitry specifically designed for the protection of its internal devices from the damaging effects of excessive static charge. nonetheless, it is suggested that conventional precautions be taken to avoid applying greater than the rated maxima. 3. parameters are valid over operating temperature range unless otherwise specified. all voltages are with respect to v ss unless otherwise noted. device specifications type supply voltage (v) frequency (mhz) temperature range ( c) type min max min max temperature range ( c) p87c554 sbxx versions 2.7 5.5 0 16 0 to +70 p87c554 sfxx versions 2.7 5.5 0 16 40 to +85
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 62 dc electrical characteristics v ss , av ss = 0 v symbol parameter test conditions limits unit symbol parameter test conditions min max unit i dd supply current operating see notes 1 and 2 f osc = 16 mhz 16 ma i id idle mode see notes 1 and 3 f osc = 16 mhz 4 ma i pd power-down current see notes 1 and 4; 2 v < v pd < v dd max 50 m a inputs v il input low voltage, except ea , p1.6, p1.7 0.5 0.2v dd 0.1 v v il1 input low voltage to ea 0.5 0.2v dd 0.3 v v il2 input low voltage to p1.6/scl, p1.7/sda 5 0.5 0.3v dd v v ih input high voltage, except xtal1, rst 0.2v dd +0.9 v dd +0.5 v v ih1 input high voltage, xtal1, rst 0.7v dd v dd +0.5 v v ih2 input high voltage, p1.6/scl, p1.7/sda 5 0.7v dd 6.0 v i il logical 0 input current, ports 1, 2, 3, 4, except p1.6, p1.7 v in = 0.45 v 50 m a i tl logical 1-to-0 transition current, ports 1, 2, 3, 4, except p1.6, p1.7 see note 6 650 m a i il1 input leakage current, port 0, ea , stadc, ew 0.45 v < v i < v dd 10 m a i il2 input leakage current, p1.6/scl, p1.7/sda 0 v < v i < 6 v 0 v < v dd < 5.5 v 10 m a i il3 input leakage current, port 5 0.45 v < v i < v dd 1 m a i il4 input leakage current, ports 1, 2, 3, 4 in high impedance mode 0.45 v < v in < v dd 10 m a outputs v ol output low voltage, ports 1, 2, 3, 4, except p1.6, p1.7 i ol = 1.6ma 7 0.4 v v ol1 output low voltage, port 0, ale, psen , pwm0 , pwm1 i ol = 3.2ma 7 0.4 v v ol2 output low voltage, p1.6/scl, p1.7/sda i ol = 3.0ma 7 0.4 v v oh output high voltage, ports 1, 2, 3, 4, except p1.6/scl, p1.7/sda v cc = 2.7 v v cc 07 v i oh = 20 m a v cc 0 . 7 v v cc = 4.5 v cc 07 v i oh = 30 m a v cc 0 . 7 v v oh1 output high voltage (port 0 in external bus mode, ale, psen , pwm0 , pwm1 ) 8 v cc = 2.7 v i oh = 3.2ma v cc 0.7 v v oh2 output high voltage (rst) i oh = 400 m a 2.4 v i oh = 120 m a 0.8v dd v r rst internal reset pull-down resistor 40 225 k w c io pin capacitance test freq = 1 mhz, t amb = 25 c 10 pf analog inputs av dd analog supply voltage: 87c554 9 av dd = v dd 0.2 v 2.7 5.5 v ai dd analog supply current: operating: port 5 = 0 to av dd 1.2 ma ai id idle mode: 87c554 50 m a ai pd power-down mode: 87c554 2 v < av pd < av dd max 50 m a
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 63 dc electrical characteristics (continued) test limits symbol parameter conditions min max unit analog inputs (continued) av in analog input voltage av ss 0.2 av dd +0.2 v av ref reference voltage: av ref av ss 0.2 v av ref+ av dd +0.2 v r ref resistance between av ref+ and av ref 10 50 k w c ia analog input capacitance 15 pf t ads sampling time (10 bit mode) 8t cy m s t ads8 sampling time (8 bit mode) 5t cy m s t adc conversion time (including sampling time, 10 bit mode) 50t cy m s t adc8 conversion time (including sampling time, 8 bit mode) 24t cy m s dl e differential non-linearity 10, 11, 12 1 lsb il e integral non-linearity 10, 13 (10 bit mode) 2 lsb il e8 integral non-linearity (8 bit mode) 1 lsb os e offset error 10, 14 (10 bit mode) 2 lsb os e8 offset error (8 bit mode) 1 lsb g e gain error 10, 15 0.4 % a e absolute voltage error 10, 16 3 lsb m ctc channel to channel matching 1 lsb c t crosstalk between inputs of port 5 17, 18 0100khz 60 db notes for dc electrical characteristics: 1. see figures 57 through 61 for i dd test conditions. 2. the operating supply current is measured with all output pins disconnected; xtal1 driven with t r = t f = 10ns; v il = v ss + 0.5 v; v ih = v dd 0.5 v; xtal2 not connected; ea = rst = port 0 = ew = v dd ; stadc = v ss . 3. the idle mode supply current is measured with all output pins disconnected; xtal1 driven with t r = t f = 10ns; v il = v ss + 0.5 v; v ih = v dd 0.5 v; xtal2 not connected; port 0 = ew = v dd ; ea = rst = stadc = v ss . 4. the power-down current is measured with all output pins disconnected; xtal2 not connected; port 0 = ew = v dd ; ea = rst = stadc = xtal1 = v ss . 5. the input threshold voltage of p1.6 and p1.7 (sio1) meets the i 2 c specification, so an input voltage below 1.5 v will be recognized as a logic 0 while an input voltage above 3.0 v will be recognized as a logic 1. 6. pins of ports 1 (except p1.6, p1.7), 2, 3, and 4 source a transition current when they are being externally driven from 1 to 0. the transition current reaches its maximum value when v in is approximately 2 v. 7. capacitive loading on ports 0 and 2 may cause spurious noise to be superimposed on the v ol s of ale and ports 1 and 3. the noise is due to external bus capacitance discharging into the port 0 and port 2 pins when these pins make 1-to-0 transitions during bus oper ations. in the worst cases (capacitive loading > 100pf), the noise pulse on the ale pin may exceed 0.8 v. in such cases, it may be desirable t o qualify ale with a schmitt trigger, or use an address latch with a schmitt trigger strobe input. i ol can exceed these conditions provided that no single output sinks more than 5ma and no more than two outputs exceed the test conditions. 8. capacitive loading on ports 0 and 2 may cause the v oh on ale and psen to momentarily fall below the 0.9 v dd specification when the address bits are stabilizing. 9. the following condition must not be exceeded: v dd 0.2 v < av dd < v dd + 0.2 v. 10. conditions: av ref = 0 v; av dd = 5.0 v. measurement by continuous conversion of av in = 20mv to 5.12 v in steps of 0.5mv, derivating parameters from collected conversion results of adc. av ref+ (87c554) = 4.977 v. adc is monotonic with no missing codes. 11. the differential non-linearity (dl e ) is the difference between the actual step width and the ideal step width. (see figure 48.) 12. the adc is monotonic; there are no missing codes. 13. the integral non-linearity (il e ) is the peak difference between the center of the steps of the actual and the ideal transfer curve after appropriate adjustment of gain and offset error. (see figure 48.) 14. the offset error (os e ) is the absolute difference between the straight line which fits the actual transfer curve (after removing gain error), and a straight line which fits the ideal transfer curve. (see figure 48.) 15. the gain error (g e ) is the relative difference in percent between the straight line fitting the actual transfer curve (after removing offset erro r), and the straight line which fits the ideal transfer curve. gain error is constant at every point on the transfer curve. (see fi gure 48.) 16. the absolute voltage error (a e ) is the maximum difference between the center of the steps of the actual transfer curve of the non-calibrated adc and the ideal transfer curve. 17. this should be considered when both analog and digital signals are simultaneously input to port 5. 18. this parameter is guaranteed by design and characterized, but is not production tested.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 64 1 0 2 3 4 5 6 7 1018 1019 1020 1021 1022 1023 1 2 3 4 5 6 7 1018 1019 1020 1021 1022 1023 1024 code out (2) (1) (5) (4) (3) 1 lsb (ideal) offset error os e offset error os e gain error g e av in (lsb ideal ) 1 lsb = av ref+ av ref 1024 (1) example of an actual transfer curve. (2) the ideal transfer curve. (3) differential non-linearity (dl e ). (4) integral non-linearity (il e ). (5) center of a step of the actual transfer curve. su00212 figure 48. adc conversion characteristic
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 65 ac electrical characteristics 16 mhz clock variable clock symbol figure parameter min max min max unit 1/t clcl 49 oscillator frequency 5 speed versions : 4; 5;s 3.5 16 mhz t lhll 49 ale pulse width 85 2t clcl 40 ns t avll 49 address valid to ale low 22 t clcl 40 ns t llax 49 address hold after ale low 32 t clcl 30 ns t lliv 49 ale low to valid instruction in 150 4t clcl 100 ns t llpl 49 ale low to psen low 32 t clcl 30 ns t plph 49 psen pulse width 142 3t clcl 45 ns t pliv 49 psen low to valid instruction in 82 3t clcl 105 ns t pxix 49 input instruction hold after psen 0 0 ns t pxiz 49 input instruction float after psen 37 t clcl 25 ns t aviv 5 49 address to valid instruction in 207 5t clcl 105 ns t plaz 49 psen low to address float 10 10 ns data memory t rlrh 50, 51 rd pulse width 275 6t clcl 100 ns t wlwh 50, 51 wr pulse width 275 6t clcl 100 ns t rldv 50, 51 rd low to valid data in 147 5t clcl 165 ns t rhdx 50, 51 data hold after rd 0 0 ns t rhdz 50, 51 data float after rd 65 2t clcl 60 ns t lldv 50, 51 ale low to valid data in 350 8t clcl 150 ns t avdv 50, 51 address to valid data in 397 9t clcl 165 ns t llwl 50, 51 ale low to rd or wr low 137 239 3t clcl 50 3t clcl +50 ns t avwl 50, 51 address valid to wr low or rd low 122 4t clcl 130 ns t qvwx 50, 51 data valid to wr transition 13 t clcl 50 ns t whqx 50, 51 data hold after wr 13 t clcl 50 ns t qvwh 51 data valid to wr high 287 7t clcl 150 ns t rlaz 50, 51 rd low to address float 0 0 ns t whlh 50, 51 rd or wr high to ale high 23 103 t clcl 40 t clcl +40 ns external clock t chcx 52 high time 20 20 t clcl t clcx ns t clcx 52 low time 20 20 t clcl t chcx ns t clch 52 rise time 20 20 ns t chcl 52 fall time 20 20 ns shift register t xlxl 53 serial port clock cycle time 750 12t clcl ns t qvxh 53 output data setup to clock rising edge 492 10t clcl 133 ns t xhqx 53 output data hold after clock rising edge 8 2t clcl 117 ns t xhdx 53 input data hold after clock rising edge 0 0 ns t xhdv 53 clock rising edge to input data valid 492 10t clcl 133 ns notes: 1. parameters are valid over operating temperature range unless otherwise specified. 2. load capacitance for port 0, ale, and psen = 100pf, load capacitance for all other outputs = 80pf. 3. interfacing the microcontroller to devices with float times up to 45ns is permitted. this limited bus contention will not cau se damage to port 0 drivers. 4. see application note an457 for external memory interface. 5. parts are guaranteed to operate down to 0hz.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 66 ac electrical characteristics (continued) symbol parameter input output i 2 c interface (refer to figure 56) 5 t hd;sta start condition hold time 14 t clcl > 4.0 m s 1 t low scl low time 16 t clcl > 4.7 m s 1 t high scl high time 14 t clcl > 4.0 m s 1 t rc scl rise time 1 m s 2 t fc scl fall time 0.3 m s < 0.3 m s 3 t su;dat1 data set-up time 250ns > 20 t clcl t rd t su;dat2 sda set-up time (before rep. start cond.) 250ns > 1 m s 1 t su;dat3 sda set-up time (before stop cond.) 250ns > 8 t clcl t hd;dat data hold time 0ns > 8 t clcl t fc t su;sta repeated start set-up time 14 t clcl > 4.7 m s 1 t su;sto stop condition set-up time 14 t clcl > 4.0 m s 1 t buf bus free time 14 t clcl > 4.7 m s 1 t rd sda rise time 1 m s 2 t fd sda fall time 0.3 m s < 0.3 m s 3 notes: 1. at 100 kbit/s. at other bit rates this value is inversely proportional to the bit-rate of 100 kbit/s. 2. determined by the external bus-line capacitance and the external bus-line pull-resistor, this must be < 1 m s. 3. spikes on the sda and scl lines with a duration of less than 3 t clcl will be filtered out. maximum capacitance on bus-lines sda and scl = 400pf. 4. t clcl = 1/f osc = one oscillator clock period at pin xtal1. for 62ns (42s) < t clcl < 285ns (16 mhz (24hz) > f osc > 3.5 mhz) the si01 interface meets the i 2 c-bus specification for bit-rates up to 100 kbit/s. 5. these values are guaranteed but not 100% production tested.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 67 explanation of the ac symbols each timing symbol has five characters. the first character is always `t' (= time). the other characters, depending on their positions, indicate the name of a signal or the logical status of that signal. the designations are: a address c clock d input data h logic level high i instruction (program memory contents) l logic level low, or ale p psen q output data r rd signal t time v valid w wr signal x no longer a valid logic level z float examples: t avll = time for address valid to ale low. t llpl = time for ale low to psen low. t pxiz ale psen port 0 port 2 a0a15 a8a15 a0a7 a0a7 t avll t pxix t llax instr in t lhll t plph t lliv t plaz t llpl t aviv su00006 t pliv figure 49. external program memory read cycle t llax ale psen port 0 port 2 rd a0a7 from ri or dpl data in a0a7 from pcl instr in p2.0p2.7 or a8a15 from dph a0a15 from pch t whlh t lldv t llwl t rlrh t rlaz t avll t rhdx t rhdz t avwl t avdv t rldv su00007 figure 50. external data memory read cycle
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 68 t llax ale psen port 0 port 2 wr a0a7 from ri or dpl data out a0a7 from pcl instr in p2.0p2.7 or a8a15 from dph a8a15 from pch t whlh t llwl t wlwh t avll t avwl t qvwx t whqx t dw su00213 figure 51. external data memory write cycle v cc 0.5 0.45v 0.7v cc 0.2v cc 0.1 t chcl t clcl t clch t clcx t chcx su00009 figure 52. external clock drive xtal1 012345678 instruction ale clock output data write to sbuf input data clear ri set ti set ri t xlxl t qvxh t xhqx t xhdx t xhdv su00027 123 0 4567 valid valid valid valid valid valid valid valid figure 53. shift register mode timing
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 69 2.4v 0.45v 2.0v 0.8v note: ac inputs during testing are driven at 2.4v for a logic `1' and 0.45v for a logic `0'. timing measurements are made at 2.0v for a logic `1' and 0.8v for a logic `0'. test points 2.0v 0.8v su00215 figure 54. ac testing input/output 2.4v note: the float state is defined as the point at which a port 0 pin sinks 3.2ma or sources 400 m a at the voltage test levels. 2.4v 0.45v 0.45v float 2.0v 0.8v 2.0v 0.8v su00216 figure 55. ac testing input, float waveform t rd t su;sta t buf t su;sto 0.7 v cc 0.3 v cc 0.7 v cc 0.3 v cc t fd t rc t fc t high t low t hd;sta t su;dat1 t hd;dat t su;dat2 t su;dat3 start condition repeated start condition sda (input/output) scl (input/output) stop condition start or repeated start condition su00107a figure 56. timing sio1 (i 2 c) interface
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 70 16 12 8 4 12 416 8 f (mhz) i dd ma 20 0 0 su01116 maximum active mode typical active mode maximum idle mode typical idle mode figure 57. 16 mhz version supply current (i dd ) as a function of frequency at xtal1 (f osc ) v dd p0 ea rst xtal1 xtal2 v ss v dd v dd v dd i dd (nc) clock signal v dd p1.6 p1.7 stadc av ss av ref ew su00218 figure 58. i dd test condition, active mode all other pins are disconnected 1 1. active mode: a. the following pins must be forced to v dd : ea , rst, port 0, and ew . b. the following pins must be forced to v ss : stadc, av ss , and av ref . c. ports 1.6 and 1.7 should be connected to v dd through resistors of sufficiently high value such that the sink current into these pins cannot exceed the i ol1 spec of these pins. d. the following pins must be disconnected: xtal2 and all pins not specified above.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 71 v dd p0 ea rst xtal1 xtal2 v ss v dd v dd i dd (nc) clock signal v dd p1.6 p1.7 stadc ew av ss av ref su00219 figure 59. i dd test condition, idle mode all other pins are disconnected 2 2. idle mode: a. the following pins must be forced to v dd : port 0 and ew . b. the following pins must be forced to v ss : rst, stadc, av ss , av ref , and ea . c. ports 1.6 and 1.7 should be connected to v dd through resistors of sufficiently high value such that the sink current into these pins cannot exceed the i ol1 spec of these pins. these pins must not have logic 0 written to them prior to this measurement. d. the following pins must be disconnected: xtal2 and all pins not specified above. v dd 0.5 0.5v 0.7v dd 0.2v dd 0.1 t chcl t clcl t clch t clcx t chcx su00220 figure 60. clock signal waveform for i dd tests in active and idle modes t clch = t chcl = 5ns v dd p0 rst xtal1 xtal2 v ss v dd v dd i dd (nc) v dd p1.6 p1.7 stadc ea ew av ss av ref su00221 figure 61. i dd test condition, power down mode all other pins are disconnected. v dd = 2 v to 5.5 v 3 3. power down mode: a. the following pins must be forced to v dd : port 0 and ew . b. the following pins must be forced to v ss : rst, stadc, xtal1, av ss , av ref , and ea . c. ports 1.6 and 1.7 should be connected to v dd through resistors of sufficiently high value such that the sink current into these pins cannot exceed the i ol1 spec of these pins. these pins must not have logic 0 written to them prior to this measurement. d. the following pins must be disconnected: xtal2 and all pins not specified above.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 72 eprom characteristics the 87c554 contains three signature bytes that can be read and used by an eprom programming system to identify the device. the signature bytes identify the device as an 87c554 manufactured by philips: (030h) = 15h indicates manufactured by philips components (031h) = 93h indicates 87c554 (60h) = 01h program verification if security bits 2 or 3 have not been programmed, the on-chip program memory can be read out for program verification. if the encryption table has been programmed, the data presented at port 0 will be the exclusive nor of the program byte with one of the encryption bytes. the user will have to know the encryption table contents in order to correctly decode the verification data. the encryption table itself cannot be read out. security bits with none of the security bits programmed the code in the program memory can be verified. if the encryption table is programmed, the code will be encrypted when verified. when only security bit 1 (see table 11) is programmed, movc instructions executed from external program memory are disabled from fetching code bytes from the internal memory, ea is latched on reset and all further programming of the eprom is disabled. when security bits 1 and 2 are programmed, in addition to the above, verify mode is disabled. when all three security bits are programmed, all of the conditions above apply and all external program memory execution is disabled. table 11. program security bits for eprom devices program lock bits 1, 2 sb1 sb2 sb3 protection description 1 u u u no program security features enabled. (code verify will still be encrypted by the encryption array if programmed.) 2 p u u movc instructions executed from external program memory are disabled from fetching code bytes from internal memory, ea is sampled and latched on reset, and further programming of the eprom is disabled. 3 p p u same as 2, also verify is disabled. 4 p p p same as 3, external execution is disabled. notes: 1. p programmed. u unprogrammed. 2. any other combination of the security bits is not defined.
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 73 plcc68: plastic leaded chip carrier; 68 leads; pedestal sot188-3
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 74 revision history date cpcn description 2002 mar 25 9397 750 09572 pqfp package details removed references to non-otp versions removed 1998 aug 14 9397 750 04273 previous release
philips semiconductors product data p87c554 80c51 8-bit microcontroller 12 clock operation 16k/512 otp/ram, 8 channel 10-bit a/d, i 2 c, pwm, capture/compare, high i/o 2002 mar 25 75 purchase of philips i 2 c components conveys a license under the philips' i 2 c patent to use the components in the i 2 c system provided the system conforms to the i 2 c specifications defined by philips. this specification can be ordered using the code 9398 393 40011. definitions short-form specification e the data in a short-form specification is extracted from a full data sheet with the same type number and title. for detailed information see the relevant data sheet or data handbook. limiting values definition e limiting values given are in accordance with the absolute maximum rating system (iec 60134). stress above one or more of the limiting values may cause permanent damage to the device. these are stress ratings only and operation of the dev ice at these or at any other conditions above those given in the characteristics sections of the specification is not implied. exposure to limi ting values for extended periods may affect device reliability. application information e applications that are described herein for any of these products are for illustrative purposes only. philips semiconductors make no representation or warranty that such applications will be suitable for the specified use without further testing or modification. disclaimers life support e these products are not designed for use in life support appliances, devices or systems where malfunction of these products can reasonably be expected to result in personal injury. philips semiconductors customers using or selling these products for use i n such applications do so at their own risk and agree to fully indemnify philips semiconductors for any damages resulting from such application. right to make changes e philips semiconductors reserves the right to make changes, without notice, in the products, including circuits, standard cells, and/or software, described or contained herein in order to improve design and/or performance. philips semiconductors ass umes no responsibility or liability for the use of any of these products, conveys no license or title under any patent, copyright, or m ask work right to these products, and makes no representations or warranties that these products are free from patent, copyright, or mask work right in fringement, unless otherwise specified. contact information for additional information please visit http://www.semiconductors.philips.com . fax: +31 40 27 24825 for sales offices addresses send e-mail to: sales.addresses@www.semiconductors.philips.com . ? koninklijke philips electronics n.v. 2002 all rights reserved. printed in u.s.a. date of release: 03-02 document order number: 9397 750 09572  

data sheet status [1] objective data preliminary data product data product status [2] development qualification production definitions this data sheet contains data from the objective specification for product development. philips semiconductors reserves the right to change the specification in any manner without notice. this data sheet contains data from the preliminary specification. supplementary data will be published at a later date. philips semiconductors reserves the right to change the specification without notice, in order to improve the design and supply the best possible product. this data sheet contains data from the product specification. philips semiconductors reserves the right to make changes at any time in order to improve the design, manufacturing and supply. changes will be communicated according to the customer product/process change notification (cpcn) procedure snw-sq-650a. data sheet status [1] please consult the most recently issued data sheet before initiating or completing a design. [2] the product status of the device(s) described in this data sheet may have changed since this data sheet was published. the l atest information is available on the internet at url http://www.semiconductors.philips.com.


▲Up To Search▲   

 
Price & Availability of P87C554SXAA

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X